github / github/codeql

Java: Improve "Learning CodeQL" docs

Offen
#3,903 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Java question
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

# Description
The "Learning CodeQL" / "CodeQL for Java" docs could probably be improved.

**Important:** When changing any queries, make sure to update the respective query console link as well.

## `types-class-hierarchy.rst`
- Could probably use `NullType` instead of checking for name `""`
- Also ignore `Wildcard` because it causes some false positives, or check that upper bound is same type or supertype?

## `annotations.rst`
- `@SuppressWarnings` `value` is an array so not necessarily a Literal, should therefore probably use `Annotation.getAValue(string)`

## `call-graph.rst`
- Says that for singleton pattern private constructor is not being called, however this is incorrect because constructor is called to create the singleton instance; it probably means "utility classes"

## `expressions-statements.rst`
- Why extend `ComparisonExpr` and override `getGreaterOperand` and `getLesserOperand` instead of using them? Would then not require two separate subclasses

## `introduce-libraries-java.rst`
- Might not check method body correctly, it appears there are statments which are the child of a method, but not its body, see [this query](https://lgtm.com/query/4799496553177136320/). However, maybe that it a bug with the extractor, it appears some of the results are for files which exist multiple times for the projects.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.