mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Add @id to example queries
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/array-access
|
||||
* @name Array access
|
||||
* @description Finds array access expressions with an index expression
|
||||
* consisting of a unary increment or decrement, e.g. 'a[i++]'.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/cast-expr
|
||||
* @name Cast expressions
|
||||
* @description Finds casts from a floating point type to an integer type.
|
||||
* @tags cast
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/catch-exception
|
||||
* @name Catch exception
|
||||
* @description Finds places where we catch exceptions of type 'System.IO.IOException'.
|
||||
* @tags catch
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/constructor-call
|
||||
* @name Call to constructor
|
||||
* @description Finds places where we call 'new System.Exception(...)'.
|
||||
* @tags call
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/empty-block
|
||||
* @name Empty blocks
|
||||
* @description Finds empty block statements.
|
||||
* @tags empty
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/empty-then
|
||||
* @name If statements with empty then branch
|
||||
* @description Finds 'if' statements where the 'then' branch is
|
||||
* an empty block statement.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/eq-true
|
||||
* @name Equality test on Boolean
|
||||
* @description Finds tests like 'x==true', 'x==false', 'x!=true', '!=false'.
|
||||
* @tags equals
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/extend-class
|
||||
* @name Class extends/implements
|
||||
* @description Finds classes/interfaces that extend/implement 'System.Collections.IEnumerator'.
|
||||
* @tags class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/extern-method
|
||||
* @name Extern methods
|
||||
* @description Finds methods that are 'extern'.
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/field-read
|
||||
* @name Read of field
|
||||
* @description Finds reads of 'VirtualAddress' (defined on 'Mono.Cecil.PE.Section').
|
||||
* @tags field
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/integer-literal
|
||||
* @name Integer literal
|
||||
* @description Finds places where we use the integer literal '0'.
|
||||
* @tags integer
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/method-call
|
||||
* @name Call to method
|
||||
* @description Finds calls to method 'Company.Class.MethodName'.
|
||||
* @tags call
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/mutual-recursion
|
||||
* @name Mutual recursion
|
||||
* @description Finds pairs of methods that call each other.
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/null-argument
|
||||
* @name Add null to collection
|
||||
* @description Finds places where we add 'null' to a collection.
|
||||
* @tags null
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/override-method
|
||||
* @name Override of method
|
||||
* @description Finds methods that directly override 'Object.ToString'.
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/qualifier
|
||||
* @name Expression qualifier
|
||||
* @description Finds qualified expressions (e.g. 'a.b()') and their qualifiers ('a').
|
||||
* @tags qualifier
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/return-statement
|
||||
* @name Return statements
|
||||
* @description Finds return statements that return 'null'.
|
||||
* @tags return
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/singleton-block
|
||||
* @name Singleton blocks
|
||||
* @description Finds block statements containing a single statement.
|
||||
* @tags block
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/switch-case
|
||||
* @name Switch statement case missing
|
||||
* @description Finds switch statements with a missing enum constant case and no default case.
|
||||
* @tags switch
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/ternary-conditional
|
||||
* @name Conditional expressions
|
||||
* @description Finds conditional expressions of the form '... ? ... : ...'
|
||||
* where the types of the resulting expressions differ.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/throw-exception
|
||||
* @name Throw exception of given type
|
||||
* @description Finds places where we throw 'System.IO.IOException' or one of its subtypes.
|
||||
* @tags throw
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/todo-comment
|
||||
* @name TODO comments
|
||||
* @description Finds comments containing the word "TODO".
|
||||
* @tags comment
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/too-many-params
|
||||
* @name Methods with many parameters
|
||||
* @description Finds methods with more than ten parameters.
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/try-finally
|
||||
* @name Try-finally statements
|
||||
* @description Finds try-finally statements without a catch clause.
|
||||
* @tags try
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/unused-local-var
|
||||
* @name Unused local variable
|
||||
* @description Finds local variables that are not accessed.
|
||||
* @tags variable
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/unused-param
|
||||
* @name Unused parameter
|
||||
* @description Finds parameters that are not accessed.
|
||||
* @tags parameter
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/void-return-type
|
||||
* @name Methods without return type
|
||||
* @description Finds methods whose return type is 'void'.
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id cs/examples/volatile-field
|
||||
* @name Fields declared volatile
|
||||
* @description Finds fields with a 'volatile' modifier.
|
||||
* @tags field
|
||||
|
||||
Reference in New Issue
Block a user