rename suspicious-method-name to suspicious-method-name-declaration

This commit is contained in:
Erik Krogh Kristensen
2019-10-01 14:37:07 +02:00
parent 0320f0f26b
commit aa1368741b
9 changed files with 5 additions and 5 deletions

View File

@@ -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. | | 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. | | 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 ## Changes to existing queries

View File

@@ -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 a class <code>Point</code> with a constructor, which was likely what the
developer meant to create. developer meant to create.
</p> </p>
<sample src="examples/SuspiciousMethodName.ts" /> <sample src="examples/SuspiciousMethodNameDeclaration.ts" />
<p> <p>
The below example is a fixed version of the above, where the interface is 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. in the first place.
</p> </p>
<sample src="examples/SuspiciousMethodNameFixed.ts" /> <sample src="examples/SuspiciousMethodNameDeclarationFixed.ts" />
</example> </example>
<references> <references>

View File

@@ -1,10 +1,10 @@
/** /**
* @name Suspicious method name * @name Suspicious method name declaration
* @description A method having the name "function", "new", or "constructor" * @description A method having the name "function", "new", or "constructor"
* is usually caused by a programmer being confused about the TypeScript syntax. * is usually caused by a programmer being confused about the TypeScript syntax.
* @kind problem * @kind problem
* @problem.severity warning * @problem.severity warning
* @id js/suspicious-method-name * @id js/suspicious-method-name-declaration
* @precision high * @precision high
* @tags correctness * @tags correctness
* typescript * typescript