mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
@@ -4,6 +4,8 @@
|
||||
* @kind problem
|
||||
* @id cpp/use-number-constant
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
* @tags maintainability
|
||||
*/
|
||||
import cpp
|
||||
import MagicConstants
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* @kind problem
|
||||
* @id cpp/use-string-constant
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
* @tags maintainability
|
||||
*/
|
||||
import cpp
|
||||
import MagicConstants
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
* to enforce invariants that should hold for the whole hierarchy.
|
||||
* @kind problem
|
||||
* @id cpp/nvi
|
||||
* @problem.severity warning
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
* @tags maintainability
|
||||
*/
|
||||
import cpp
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
* to enforce invariants that should hold for the whole hierarchy.
|
||||
* This is especially problematic in classes with many
|
||||
* dependencies or dependents.
|
||||
* @kind table
|
||||
* @kind problem
|
||||
* @id cpp/nvi-hub
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
* @tags maintainability
|
||||
*/
|
||||
import cpp
|
||||
|
||||
@@ -19,4 +22,4 @@ where f.hasSpecifier("public") and
|
||||
fclass = f.getDeclaringType() and
|
||||
hubIndex = fclass.getMetrics().getAfferentCoupling() * fclass.getMetrics().getEfferentCoupling() and
|
||||
hubIndex > 100
|
||||
select f.getFile(), f, "Avoid having public virtual methods (NVI idiom)"
|
||||
select f, "Avoid having public virtual methods (NVI idiom)"
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
* the included elements are used.
|
||||
* @kind problem
|
||||
* @id cpp/unused-includes
|
||||
* @problem.severity warning
|
||||
* @problem.severity recommendation
|
||||
* @precision low
|
||||
* @tags maintainability
|
||||
* useless-code
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* @kind problem
|
||||
* @id cpp/more-64-bit-waste
|
||||
* @problem.severity warning
|
||||
* @tags maintainability
|
||||
* portability
|
||||
*/
|
||||
|
||||
import semmle.code.cpp.padding.Padding
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
* @kind problem
|
||||
* @id cpp/non-portable-printf
|
||||
* @problem.severity warning
|
||||
* @tags maintainability
|
||||
* portability
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
* that by reordering them one could reduce the amount of internal padding on a 64-bit architecture.
|
||||
* @kind problem
|
||||
* @id cpp/suboptimal-64-bit-type
|
||||
* @problem.severity warning
|
||||
* @problem.severity recommendation
|
||||
* @tags efficiency
|
||||
*/
|
||||
|
||||
import semmle.code.cpp.padding.Padding
|
||||
|
||||
Reference in New Issue
Block a user