SonarQube JavaScript 2.11 发布
欢迎加入运维网交流群:263444886SonarQube JavaScript 2.11发布,这个版本加入了16项新规则实施一些与ECMAScript 2015相关的编码实践(原ECMAScript 6或ECMAScript和谐版)。
16项新规则:
[*] “arguments” should not be accessed directly (api-design, es2015)
[*] “import” should be used to include external code (convention, es2015, obsolete)
[*] Attempts should not be made to update “const” variables (bug, es2015)
[*] Braces and parentheses should be used consistently with arrow functions (convention, es2015)
[*] Class methods should be used instead of “prototype” assignments (es2015)
[*] Class names and file names should match (confusing, es2015)
[*] Default parameters should not cause side effects (es2015, pitfall)
[*] Destructuring syntax should be used for assignments (clumsy, es2015)
[*] Function parameters with default values should be last (bug, es2015)
[*] Generators should “yield” something (es2015, suspicious)
[*] Object literal shorthand syntax should be used (convention, es2015)
[*] Shorthand object properties should be grouped at the beginning or end of an object declaration (convention, es2015)
[*] Template strings should be used instead of concatenation (clumsy, es2015)
[*] Unchanged variables should be marked “const” (es2015)
[*] Variables should be declared with “let” or “const” (bad-practice, es2015)
[*] Wildcard imports should not be used (es2015, pitfall)
漏洞:
[*] - False positive CommentedCode
[*] - False positive ExpressionComplexity (S1067)
[*] - False Positive SemicolonCheck: nested class declaration
[*] - False Positive VariableDeclarationWithoutVar (S2703): "module" and "exports" in node.js project
[*] - Support octal literals
[*] - ClassCastException in destructuring assignment
[*] - False Positive NonEmptyCaseWithoutBreak: complex flow
[*] - False Positive UselessStringOperationCheck (S1154) : "replace" with function parameter
改进:
[*] - Improve DeadStore (S1854): consider execution order
[*] - Provide semantic support of ECMAScript 2015
[*] - Ignore functions passed as parametes to AngularJS module methods in function size rules
[*] - Simplify the API to create new issues
[*] - Tune "Sonar way" Quality Profile to cover only generally accepted conventions
[*] - Improve UnreachableCode (S1763): consider execution order
[*] - Improve type-inference: consider unary operations
[*] - Remove visitToken() and visitTrivia() from SubscriptionVisitor
[*] - Update description of TrailingComma
[*] - Improve issue location for rules checking variable name
新特性:
[*] - Rule: Variables should be declared with "let" or "const"
[*] - Rule: Unchanged variables should be marked "const"
[*] - Rule: Attempts should not be made to update "const" variables
[*] - Rule: Object literal shorthand syntax should be used
[*] - Rule: Shorthand object properties should be grouped at the beginning or end of an object declaration
[*] - Rule: Function parameters with default values should be last
[*] - Rule: Template strings should be used instead of concatenation
[*] - Rule: "arguments" should not be accessed directly
[*] - Rule: Destructuring syntax should be used for assignments
[*] - Rule: Default parameters should not cause side effects
[*] - Rule: Variable declarations should be placed appropriately for their scope
[*] - Rule: Generators should "yield" something
[*] - Rule: Arrow function should use consistently parentheses and curly braces
[*] - Rule: Class methods should be used instead of "prototype" assignments
[*] - Rule: "import" should be used to include external code
[*] - Rule: Wildcard imports should not be used
[*] - Rule: Class names and file names should match
[*] - Remove property "sonar.javascript.exclude.minifiedFiles"
任务:
[*] - Refactor JavaScriptCheckContext not to use Issuable anymore
[*] - Provide profile generator for IT-ruling
[*] - Update description of VariableDeclarationWithoutVar
子任务:
[*] - Remove Semicolon rule from default quality profile
[*] - Remove TrailingComment rule from default quality profile
[*] - Support block-scoped variables
[*] - Create symbol and type for class declaration
[*] - Create type for arrow function
[*] - Create symbols for import
[*] - Remove TrailingComma rule from default quality profile
[*] - Remove FunctionName (S100) rule from default quality profile
[*] - Remove TrailingWhitespace rule from default quality profile
[*] - Remove TabCharacter rule from default quality profile
页:
[1]