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 py/examples/backticks
|
||||
* @name String conversion expressions
|
||||
* @description Finds `String conversions` expressions (expressions enclosed in backticks), which are removed in Python 3
|
||||
* @tags backtick
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/builtin-object
|
||||
* @name Builtin objects
|
||||
* @description Finds expressions that refer to an object in the builtins module (like int or None).
|
||||
* @tags reference
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/call
|
||||
* @name Calls to function
|
||||
* @description Finds calls to any function named "len"
|
||||
* @tags call
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/catch-exception
|
||||
* @name Handle exception of given class
|
||||
* @description Finds places where we handle MyExceptionClass exceptions
|
||||
* @tags catch
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/conditional-expression
|
||||
* @name Conditional expressions
|
||||
* @description Finds conditional expressions of the form '... if ... else ...'
|
||||
* where the classes of the sub-expressions differ
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/elif
|
||||
* @name Elif statement
|
||||
* @description Finds `elif` sub-statements within `if` statements
|
||||
* @tags if
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/emptyblock
|
||||
* @name Empty blocks
|
||||
* @description Finds the first statement in a block consisting of nothing but Pass statements
|
||||
* @tags empty
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/emptythen
|
||||
* @name If statements with empty then branch
|
||||
* @description Finds 'if' statements where the "then" branch
|
||||
* consists entirely of Pass statements
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/eq-true
|
||||
* @name Equality test on boolean
|
||||
* @description Finds tests like `==true`, `==false`, `"!=true`, `is false`
|
||||
* @tags equals
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/equalitystmt
|
||||
* @name Equalities as expression statements
|
||||
* @description Finds `==` equality expressions that form a statement
|
||||
* @tags comparison
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/extend-class
|
||||
* @name Class subclasses
|
||||
* @description Finds classes that subclass MyClass
|
||||
* @tags class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/filename
|
||||
* @name File with given name
|
||||
* @description Finds files called `spam.py`
|
||||
* @tags file
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/generator
|
||||
* @name Generator functions
|
||||
* @description Finds generator functions
|
||||
* @tags generator
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/integer-literal
|
||||
* @name Integer literal
|
||||
* @description Finds places where we use the integer literal `0`
|
||||
* @tags integer
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/method-call
|
||||
* @name Call to method
|
||||
* @description Finds calls to MyClass.methodName
|
||||
* @tags call
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/mutualrecursion
|
||||
* @name Mutual recursion
|
||||
* @description Finds pairs of functions that call each other
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/new-instance
|
||||
* @name Create new object
|
||||
* @description Finds places where we create a new instanceof `MyClass`
|
||||
* @tags call
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/override-method
|
||||
* @name Override of method
|
||||
* @description Finds methods that overide MyClass.methodName
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/print
|
||||
* @name Find prints
|
||||
* @description Find print statements or calls to the builtin function 'print'
|
||||
* @tags print
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/private-access
|
||||
* @name Private access
|
||||
* @description Find accesses to "private" attributes (those starting with an underscore)
|
||||
* @tags access
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/raise-exception
|
||||
* @name Raise exception of a class
|
||||
* @description Finds places where we raise AnException or one of its subclasses
|
||||
* @tags throw
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/raw-string
|
||||
* @name Raw string literals
|
||||
* @description Finds string literals with an 'r' prefix
|
||||
* @tags string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/recursion
|
||||
* @name Recursion
|
||||
* @description Finds functions that call themselves
|
||||
* @tags method
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/singlequotestring
|
||||
* @name Single-quoted string literals
|
||||
* @description Finds string literals using single quotes
|
||||
* @tags string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/store-none
|
||||
* @name Store None to collection
|
||||
* @description Finds places where `None` is used as an index when storing to a collection
|
||||
* @tags None
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/todocomment
|
||||
* @name TODO comments
|
||||
* @description Finds comments containing the word "TODO"
|
||||
* @tags comment
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/too-many-params
|
||||
* @name Functions with many parameters
|
||||
* @description Finds functions with more than 7 parameters
|
||||
* @tags function
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
* @id py/examples/tryfinally
|
||||
* @name Try-finally statements
|
||||
* @description Finds try-finally statements without an exception handler
|
||||
* @tags try
|
||||
|
||||
Reference in New Issue
Block a user