FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/java/ql/src/Complexity/BlockWithTooManyStatements.ql at main · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
474
(474)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Complexity
/
BlockWithTooManyStatements.ql
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 650 Bytes
Breadcrumbs
codeql
/
java
/
ql
/
src
/
Complexity
/
BlockWithTooManyStatements.ql
Copy path
File metadata and controls
25 lines (22 loc) · 650 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @name Block with too many statements
* @description A block that contains too many complex statements becomes unreadable and
* unmaintainable.
* @kind problem
* @problem.severity recommendation
* @precision low
* @id java/complex-block
* @tags maintainability
* testability
* complexity
*/
import
java
class
ComplexStmt
extends
Stmt
{
ComplexStmt
(
)
{
this
instanceof
LoopStmt
or
this
instanceof
SwitchStmt
}
}
from
BlockStmt
b
,
int
n
where
n
=
count
(
ComplexStmt
s
|
s
=
b
.
getAStmt
(
)
)
and
n
>
3
select
b
,
"Block with too many statements ("
+
n
.
toString
(
)
+
" complex statements in the block)."
Back
|
FazBrowse Home
|
New Git URL