Merge pull request #11499 from michaelnebel/java/kotlinstd

Kotlin: Migrate standard library models to data extensions.
This commit is contained in:
Michael Nebel
2022-12-02 14:44:50 +01:00
committed by GitHub
12 changed files with 6513 additions and 6312 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -98,7 +98,6 @@ private module Frameworks {
private import semmle.code.java.frameworks.apache.Collections
private import semmle.code.java.frameworks.apache.Lang
private import semmle.code.java.frameworks.Flexjson
private import semmle.code.java.frameworks.generated
private import semmle.code.java.frameworks.guava.Guava
private import semmle.code.java.frameworks.jackson.JacksonSerializability
private import semmle.code.java.frameworks.javaee.jsf.JSFRenderer
@@ -135,7 +134,7 @@ private module Frameworks {
*
* Extend this class to add additional source definitions.
*/
class SourceModelCsv = SourceModelCsvInternal;
deprecated class SourceModelCsv = SourceModelCsvInternal;
private class SourceModelCsvInternal extends Unit {
/** Holds if `row` specifies a source definition. */
@@ -149,7 +148,7 @@ private class SourceModelCsvInternal extends Unit {
*
* Extend this class to add additional sink definitions.
*/
class SinkModelCsv = SinkModelCsvInternal;
deprecated class SinkModelCsv = SinkModelCsvInternal;
private class SinkModelCsvInternal extends Unit {
/** Holds if `row` specifies a sink definition. */
@@ -163,7 +162,7 @@ private class SinkModelCsvInternal extends Unit {
*
* Extend this class to add additional flow summary definitions.
*/
class SummaryModelCsv = SummaryModelCsvInternal;
deprecated class SummaryModelCsv = SummaryModelCsvInternal;
private class SummaryModelCsvInternal extends Unit {
/** Holds if `row` specifies a summary definition. */
@@ -177,7 +176,7 @@ private class SummaryModelCsvInternal extends Unit {
*
* Extend this class to add additional negative summary definitions.
*/
class NegativeSummaryModelCsv = NegativeSummaryModelCsvInternal;
deprecated class NegativeSummaryModelCsv = NegativeSummaryModelCsvInternal;
private class NegativeSummaryModelCsvInternal extends Unit {
/** Holds if `row` specifies a negative summary definition. */
@@ -555,7 +554,7 @@ module ModelValidation {
not type.regexpMatch("[a-zA-Z0-9_\\$<>]+") and
result = "Dubious type \"" + type + "\" in " + pred + " model."
or
not name.regexpMatch("[a-zA-Z0-9_]*") and
not name.regexpMatch("[a-zA-Z0-9_\\-]*") and
result = "Dubious name \"" + name + "\" in " + pred + " model."
or
not signature.regexpMatch("|\\([a-zA-Z0-9_\\.\\$<>,\\[\\]]*\\)") and

View File

@@ -1,9 +0,0 @@
/**
* A module importing all generated Models as Data models.
*/
import java
private module GeneratedFrameworks {
private import kotlin.StdLibGenerated
}

View File

@@ -0,0 +1,14 @@
/**
* @name Extract MaD negative summary model rows.
* @description This extracts the Models as data negative summary model rows.
* @id java/utils/modelconverter/generate-data-extensions-negative-summary
*/
import java
import semmle.code.java.dataflow.ExternalFlow
from string package, string type, string name, string signature, string provenance
where
negativeSummaryModel(package, type, name, signature, provenance) and
provenance != "generated"
select package, type, name, signature, provenance order by package, type, name, signature

View File

@@ -1,7 +0,0 @@
/**
* CSV Validation of negative summaries.
*/
import java
import semmle.code.java.dataflow.ExternalFlow
import ModelValidation