Showing content from https://docs.pmd-code.org/latest/pmd_rules_ecmascript.html below:
JavaScript Rules | PMD Source Code Analyzer
Index of all built-in rules available for JavaScript
Table of Contents Best Practices
Rules which enforce generally accepted best practices.
- AvoidWithStatement: Avoid using with - itâs bad news
- ConsistentReturn: ECMAScript does provide for return types on functions, and therefore there is no solid rule as toâ¦
- GlobalVariable: This rule helps to avoid using accidently global variables by simply missing the "var" declaratioâ¦
- ScopeForInVariable: A for-in loop in which the variable name is not explicitly scoped to the enclosing scope with theâ¦
- UseBaseWithParseInt: This rule checks for usages of parseInt. While the second parameter is optional and usually defauâ¦
Code Style
Rules which enforce a specific coding style.
- AssignmentInOperand: Avoid assignments in operands; this can make code more complicated and harder to read. This is sâ¦
- ForLoopsMustUseBraces: Avoid using âforâ statements without using curly braces.
- IfElseStmtsMustUseBraces: Avoid using if..else statements without using curly braces.
- IfStmtsMustUseBraces: Avoid using if statements without using curly braces.
- NoElseReturn: The else block in a if-else-construct is unnecessary if the âifâ block contains a return. Then thâ¦
- UnnecessaryBlock: An unnecessary Block is present. Such Blocks are often used in other languages to introduce a neâ¦
- UnnecessaryParentheses: Unnecessary parentheses should be removed.
- UnreachableCode: A âreturnâ, âbreakâ, âcontinueâ, or âthrowâ statement should be the last in a block. Statements aâ¦
- WhileLoopsMustUseBraces: Avoid using âwhileâ statements without using curly braces.
Error Prone
Rules to detect constructs that are either broken, extremely confusing or prone to runtime errors.
Performance
Rules that flag suboptimal code.
- AvoidConsoleStatements: Using the console for logging in production might negatively impact performance. In addition, logâ¦
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4