mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
rename suspicious-method-name to suspicious-method-name-declaration
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|---------------------------------------------------------------------------|-------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Unused index variable (`js/unused-index-variable`) | correctness | Highlights loops that iterate over an array, but do not use the index variable to access array elements, indicating a possible typo or logic error. Results are shown on LGTM by default. |
|
||||
| Loop bound injection (`js/loop-bound-injection`) | security, external/cwe/cwe-834 | Highlights loops where a user-controlled object with an arbitrary .length value can trick the server to loop indefinitely. Results are not shown on LGTM by default. |
|
||||
| Suspicious method name (`js/suspicious-method-name`) | correctness, typescript, methods | Highlights suspiciously named methods where the developer likely meant to write a constructor or function. Results are shown on LGTM by default. |
|
||||
| Suspicious method name (`js/suspicious-method-name-declaration`) | correctness, typescript, methods | Highlights suspiciously named methods where the developer likely meant to write a constructor or function. Results are shown on LGTM by default. |
|
||||
|
||||
## Changes to existing queries
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ and a method called <code>constructor</code>. The interface does not declare
|
||||
a class <code>Point</code> with a constructor, which was likely what the
|
||||
developer meant to create.
|
||||
</p>
|
||||
<sample src="examples/SuspiciousMethodName.ts" />
|
||||
<sample src="examples/SuspiciousMethodNameDeclaration.ts" />
|
||||
|
||||
<p>
|
||||
The below example is a fixed version of the above, where the interface is
|
||||
@@ -41,7 +41,7 @@ instead declared as a class, thereby describing the type the developer meant
|
||||
in the first place.
|
||||
</p>
|
||||
|
||||
<sample src="examples/SuspiciousMethodNameFixed.ts" />
|
||||
<sample src="examples/SuspiciousMethodNameDeclarationFixed.ts" />
|
||||
|
||||
</example>
|
||||
<references>
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @name Suspicious method name
|
||||
* @name Suspicious method name declaration
|
||||
* @description A method having the name "function", "new", or "constructor"
|
||||
* is usually caused by a programmer being confused about the TypeScript syntax.
|
||||
* @kind problem
|
||||
* @problem.severity warning
|
||||
* @id js/suspicious-method-name
|
||||
* @id js/suspicious-method-name-declaration
|
||||
* @precision high
|
||||
* @tags correctness
|
||||
* typescript
|
||||
Reference in New Issue
Block a user