Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring cleaning compiler warnings #1410

Merged
merged 11 commits into from
Jan 15, 2024
Merged

Spring cleaning compiler warnings #1410

merged 11 commits into from
Jan 15, 2024

Conversation

KuechA
Copy link
Contributor

@KuechA KuechA commented Jan 12, 2024

No description provided.

@oxisto
Copy link
Member

oxisto commented Jan 12, 2024

Good idea! Could we also get rid of some of the compiler warnings while we are at it?

> Task :cpg-core:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/TranslationManager.kt:328:15 Unchecked cast: Any to MutableMap<String, String>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/CompilationDatabase.kt:303:17 Name shadowed: isLibrary
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/DeclarationHolder.kt:70:49 Unchecked cast: DeclarationHolder to T
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt:611:17 Unchecked cast: Expression to N
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt:618:7 Unchecked cast: List<Node> to List<CallExpression>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt:111:19 Unchecked cast: MetadataProvider? to CodeAndLocationProvider<Any>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/StatementHolder.kt:79:17 Name shadowed: before
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edge/PropertyEdge.kt:180:48 Unchecked cast: PropertyEdge<out Node> to PropertyEdge<T>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edge/PropertyEdge.kt:199:72 Unchecked cast: Node to T
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edge/PropertyEdge.kt:220:29 Unchecked cast: Collection<*>! to MutableCollection<Node>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/ForEachStatement.kt:65:13 Parameter 'value' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/CommentMatcher.kt:151:17 Name shadowed: closestLine
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/SubgraphWalker.kt:166:38 Unchecked cast: Any to List<PropertyEdge<Node>>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/SubgraphWalker.kt:173:45 Unchecked cast: Any to Collection<Node>
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt:145:5 Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt:162:5 Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt:179:5 Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt:191:5 Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/helpers/Util.kt:203:5 Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/CXXCallResolverHelper.kt:268:5 Parameter 'ctx' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/ControlDependenceGraphPass.kt:271:5 Parameter 'currentWorklist' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/EvaluationOrderGraphPass.kt:794:28 Parameter 'loopStatement' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/Pass.kt:129:60 Unchecked cast: PassConfiguration? to T
w: file:///Users/oxisto/Repositories/cpg/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/processing/strategy/Strategy.kt:40:21 Parameter 'x' is never used

> Task :cpg-analysis:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/UnreachableEOGPass.kt:95:5 Parameter 'currentWorklist' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt:66:69 Conditional branch result of type String is implicitly cast to Any?
w: file:///Users/oxisto/Repositories/cpg/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt:66:121 Conditional branch result of type T is implicitly cast to Any?
w: file:///Users/oxisto/Repositories/cpg/cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/query/QueryTree.kt:148:32 Unchecked cast: T to Comparable<Any>

> Task :cpg-language-java:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt:381:9 Parameter 'annotationConstDecl' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/DeclarationHandler.kt:390:9 Parameter 'annotationMemberDecl' is never used
w: file:///Users/oxisto/Repositories/cpg/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StatementHandler.kt:399:13 Name shadowed: token
w: file:///Users/oxisto/Repositories/cpg/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StatementHandler.kt:409:13 Name shadowed: token
w: file:///Users/oxisto/Repositories/cpg/cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/StatementHandler.kt:555:40 Name shadowed: stmt

> Task :cpg-language-cxx:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-language-cxx/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/CXXExtraPass.kt:60:48 Parameter 'currClass' is never used

> Task :cpg-language-go:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-language-go/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/golang/GoLanguageFrontend.kt:220:13 Name shadowed: type

> Task :cpg-neo4j:compileKotlin
w: file:///Users/oxisto/Repositories/cpg/cpg-neo4j/src/main/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/Application.kt:409:26 'autoIndex(String!): Configuration.Builder!' is deprecated. Deprecated in Java
w: file:///Users/oxisto/Repositories/cpg/cpg-neo4j/src/main/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/Application.kt:495:52 Unchecked cast: KClass<out Any!> to KClass<out Pass<*>>

@KuechA KuechA marked this pull request as ready for review January 15, 2024 12:56
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

63.7% Coverage on New Code (required ≥ 75%)

See analysis details on SonarCloud

Copy link
Collaborator

@konradweiss konradweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oxisto oxisto changed the title 2024 january cleanup of sonar warnings Spring cleaning compiler warnings Jan 15, 2024
@oxisto oxisto merged commit 4502ed5 into main Jan 15, 2024
@oxisto oxisto deleted the 2024-january-cleanup branch January 15, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants