Merge pull request #456 from geoffw0/query-tags

CPP: Query tags 1
This commit is contained in:
Jonas Jensen
2018-11-21 16:13:23 +01:00
committed by GitHub
8 changed files with 22 additions and 5 deletions

View File

@@ -4,6 +4,8 @@
* @kind problem
* @id cpp/use-number-constant
* @problem.severity recommendation
* @precision low
* @tags maintainability
*/
import cpp
import MagicConstants

View File

@@ -4,6 +4,8 @@
* @kind problem
* @id cpp/use-string-constant
* @problem.severity recommendation
* @precision low
* @tags maintainability
*/
import cpp
import MagicConstants

View File

@@ -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

View File

@@ -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)"

View File

@@ -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

View File

@@ -4,6 +4,8 @@
* @kind problem
* @id cpp/more-64-bit-waste
* @problem.severity warning
* @tags maintainability
* portability
*/
import semmle.code.cpp.padding.Padding

View File

@@ -5,6 +5,8 @@
* @kind problem
* @id cpp/non-portable-printf
* @problem.severity warning
* @tags maintainability
* portability
*/
import cpp

View File

@@ -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