Skip to content

Remove unused classes from queries #315

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

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions cpp/autosar/src/rules/A15-3-3/MissingCatchHandlerInMain.ql
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ import codingstandards.cpp.exceptions.ThirdPartyExceptions
import codingstandards.cpp.standardlibrary.Exceptions
import codingstandards.cpp.EncapsulatingFunctions

/** A `TryStmt` which covers the full body of a function. */
class FullFunctionBodyTryStmt extends TryStmt {
FullFunctionBodyTryStmt() {
this instanceof FunctionTryStmt
or
exists(Function f, BlockStmt functionBlock |
functionBlock = f.getBlock() and
this = functionBlock.getStmt(0) and
(
functionBlock.getNumStmt() = 1
or
functionBlock.getNumStmt() = 2 and
functionBlock.getStmt(1) instanceof ReturnStmt
)
)
}
}

/*
* The strategy for this query is to find a Stmt in the root BlockStmt which can throw one of the
* ExceptionTypes that should be handled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
import cpp
import codingstandards.cpp.autosar

// for readability we define a "fundamental" type
class FundamentalType extends Type {
FundamentalType() { this instanceof BuiltInType }
}

from Variable v
where
not isExcluded(v,
Expand Down