Code Inspections in JavaScript
Inspection | Description | Default Severity |
---|---|---|
JSLint | Runs JSLint validator for specified JavaScript file. | Disabled |
JSHint | Runs JSHint validator for specified JavaScript file. | Disabled |
Closure Linter | Runs Closure Linter that enforces the guidelines set by the Google JavaScript Style Guide. The linter handlesstyle issues so that you can focus on the code. | Disabled |
JSCS | Runs JSCS - JavaScript Code Style checker for specified JavaScript file. | Disabled |
ESLint | Runs ESLint validator for specified JavaScript file. | Disabled |
Standard Code Style | Reports errors according to JavaScript Standard Style. | Disabled |
JavaScript general errors | This inspection is for ability to suppress irrelevant JavaScript errors like assignment to const, continue without loop, e.t.c. | Error |
Unresolved JavaScript variable | Checks JavaScript referenced variables and fields to be valid ones.The validation works in JavaScript, html or jsp files. | Weak warning |
Unresolved JavaScript function | Checks JavaScript called functions to be valid ones.The validation works in JavaScript, html or jsp files. | Weak warning |
Potentially invalid constructor usage | This inspection reports JavaScript potentially invalid constructor function usages such as: using non constructor in new, usingconstructor's prototype, reportconstructor call without new. Constructor function assumed to have upper case name (optional) or have explicit JSDoc @constructor tag.The validation works in JavaScript, html or jsp files. | Warning |
Unnecessary semicolon | Checks JavaScript source code for unneeded semicolons.The validation works in JavaScript, html or jsp files. | Warning |
Unneeded last comma in array literal | Reports when a trailing comma is used in array literals in JavaScript code. The warning is reported only when the JavaScript language version is set to JavaScript 1.8.5, ECMAScript 3 or 5.1. Trailing commas in arrays are allowed according to these specifications, however, some browsers might throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation. | Warning |
Unneeded last comma in object literal | Reports when a trailing comma is used in object literals in JavaScript code. The warning is reported only when the JavaScript language version is set to JavaScript 1.8.5, ECMAScript 3 or 5.1. Trailing commas in object literals are allowed according to these specifications, however, some browsers might throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation. | Warning |
Implicitly declared global JavaScript variable | Checks JavaScript variables to be declared explicitly with var statement.The validation works in JavaScript, html or jsp files. | Weak warning |
Unused assignment | Checks JavaScript for unused assignments.The validation works in JavaScript, ActionScript, HTML and JSP files. | Warning |
Type mismatch | Checks JavaScript called function parameters, return values, assigned expressions to be of correct type.The validation works in JavaScript, html or jsp files. | Weak warning |
Signature mismatch | Checks JavaScript called function arguments, return values, assigned expressions to be of correct type.The validation works in JavaScript, html or jsp files. | Weak warning |
Validate JSDoc | This inspection validates references in JavaScript / ActionScript documentation comments (JSDoc / ASDoc). | Warning |
Duplicate JavaScript declaration | Checks JavaScript declaration to be declared once in current scope.The validation works in JavaScript, html, or jsp files. | Warning |
Duplicate block scoped declaration | Checks that JavaScript block scoped declaration (let/const) is not redeclared again.The validation works in JavaScript, TypeScript, html, or jsp files. | Error |
Deprecated JavaScript symbol | Checks for using deprecated JavaScript functions and variables.The validation works in JavaScript, html, or jsp files. | Weak warning |
Referencing mutable variable from closure | Checks for accessing mutable JavaScript variables in nested functions.The validation works in JavaScript, html, or jsp files. | Warning |
Possibly incorrect target of indexed property access | This inspection reports JavaScript potentially invalid indexed property access such as Array[1].The validation works in JavaScript, html, or jsp files. | Warning |
Potentially invalid reference to 'this' from closure | Checks for JavaScript this to be the same in closure and in outer context.The validation works in JavaScript, html, or jsp files. | Warning |
Potentially invalid reference to 'this' of a class from closure | Warns against a common mistake of trying to reference a member of an ECMAScript class via this. qualifier in a nested function that is not a lambda. | Warning |
Unfiltered for..in loop | Checks for any instances of unfiltered for-in loops in JavaScript.The use of this construct results in processing inherited or unexpected properties. You need to filter own propertieswith hasOwnProperty() method. The validation works in JavaScript, html or jsp files. | Warning |
Unused local symbol | Checks JavaScript parameter, local variable, function, classes and private member declarationsto be used in given file scope.The validation works in JavaScript, ActionScript, HTML and JSP files. | Warning |
Unused ES6 / TypeScript imports | Checks that JavaScript or TypeScript import binding or specifier is used in a given module scope.The validation works in ES6 and TypeScript files. | Warning |
Missing await for an async function call | Missing await call for an async function can produce unexpected behaviour. | Information |
Missing React import with JSX | When using JSX, it's usually required to have import from React in the file scope. Otherwise, the code may not compile properly. | Weak warning |
Possibly async function | Highlights functions that were possibly intended to be async but are missing the async modifier. | Weak warning |
Property can be replaced with shorthand | Highlights and provides fixes to convert object properties to ES6 shorthand style. | Information |
Braces around arrow function body can be removed | This inspection highlights arrow functions where the body contains exactly one statement and can be converted to concise syntax without braces. | Information |
Unnecessary parentheses | This inspection reports parentheses when they are redundant. In expressions: var x = ((1) + 2) + 3 Arrow function argument lists: var incrementer = (x) => x + 1 TypeScript and Flow type declarations: type Card = (Suit & Rank) | (Suit & Number) | Information |
Suspicious usage of 'bind' with arrow function | Warns if | Warning |
'var' used instead of 'let' or 'const' | Reports | Warning |
'require()' is used instead of 'import' | Reports when | Information |
'module.exports' is used instead of 'export' | Reports when | Information |
Function expression is used instead of arrow function | Helps to replace function expressions with arrow functions. | Information |
String concatenation is used instead of string template | Helps to replace concatenations of strings and references to template strings. | Information |
'for..in' is used instead of 'for..of' | Converts | Information |
Result of method call returning a promise is ignored | This inspection reports function calls that return a Promise that is not later used. These are usually unintended and indicate an error. | Weak warning |
Unused global symbol | Checks if JavaScript public functions, variables, classes, and properties are used in global scope.The validation works in JavaScript, ActionScript, HTML and JSP files. | Warning |
Suspicious name combination | Reports assignments and function calls where the name of the variable to whicha value is assigned or the function parameter does not seem to match the name of the value assigned to it.For example:
| Warning |
There is no locally stored library for the HTTP link. | Checks that URL of an external JavaScript library is associated witha locally stored file used for code completion and navigation. | Warning |
Mismatched query and update of collection | Warning | |
Bitwise operator usage | This inspection reports suspicious usages of bitwise AND ("&") and OR ("|") operators.Usually it is a common typo and user expect a result according to the boolean operations AND ("&&") and OR ("||"). | Warning |
Closure compiler syntax | Checks code for warnings implied by Google Closure Compiler annotations.This includes correct usage of @abstract, @interface and @implements tags. | Warning |
Undefined property assignment | This inspection reports assignments to undefined properties of explicitly type-annotated variables. | Weak warning |
Variable declarations are at the scope start | This inspection checks that all local variables declarations are at the beginning of the current function. | Disabled |
Primitive type object wrapper used | Checks for improper usage of wrappers for JavaScript primitive types. Also, warning will be produced when property of primitive type ismodified, as assigned value will be lost. | Warning |
Comparison with NaN | Checks code for comparisons with NaN. Comparisons like expr == NaN or expr === NaN are always evaluated to false. | Warning |
jQuery usage efficiency | Checks that jQuery selectors are used in an efficient way.It warns about duplicated selectors which could be cached and optionally about attribute and pseudo-selectors usage. | Warning |
@private and @protected members accessibility | This inspection checks that JavaScript members marked with @private and @protected tags are visible in current context. | Warning |
Constructor returns primitive value | Checks that function recognized as constructor does not return primitive values.When called with new, this value will be lost and object will be returned instead. To avoid warnings, you can explicitly specifyfunction's return type with @return tag. | Warning |
JSDoc comment matches function signature | Checks that parameters defined within JSDoc comment match function's actual parameters, i.e. have the same names and quantity. | Warning |
Consecutive commas in array literal | Checks that array literal doesn't contain consecutive commas. Skipped element takes undefined value,but it could be done unintentionally, e.g. when commas are at the end of one line and at the beginning of the following. | Warning |
Call to 'document.write()' | This inspection reports JavaScript method calls to document.write() or document.writeln() . Most uses of these calls are better performed using explicit DOM calls such as getElementByID() and createElement() . Additionally, the write() and writeln() calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs. | Disabled |
Use of 'innerHTML' property | This inspection reports JavaScript accesses to DOM nodes as text using the innerHTML property. Most uses of innerHTML are better performed using explicit DOM calls such as getElementByID() and createElement() . Additionally, innerHTML will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can lead to difficult to diagnose bugs. | Disabled |
Platform detection | This inspection reports common JavaScript patterns for detecting the browser or operating system in which script is being run. In addition to pointing out non-portable constructs, these platform detection patterns are often incomplete and easily fooled. For most cases, detection of individual environment features is preferable to attempting to detect the entire platform. Patterns detected include document.all , document.layers , navigator.userAgent , navigator.oscpu , navigator.appName , navigator.appCodeName , and navigator.platform | Disabled |
XHTML incompatibilities | This inspection reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include document.body , document.images , document.applets , document.links , document.forms , and document.anchors . | Disabled |
Loop statement that doesn't loop | This inspection reports any instance of for , while and do statements in JavaScript content whose bodies are guaranteed to execute at most once. Normally, this is an indication of a bug. Powered by InspectionJS | Warning |
Infinite loop statement | This inspection reports any instances of for , while , or do statements which can only exit by throwing an exception. While such statements may be correct, they are often a symptom of coding errors. | Warning |
Infinite recursion | This inspection reports any instances of JavaScript functions which must either recurseinfinitely or throw an exception. functions reported by this inspection can notreturn normally. | Warning |
Pointless boolean expression | This inspection reports any instances of pointless or pointlessly complicated boolean expressions in JavaScript content. Such expressions include anding with true, oring with false, equality comparison with a boolean literal, or negation of a boolean literal. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do. | Warning |
Pointless arithmetic expression | This inspection reports any instances of pointless arithmetic expressions in JavaScript content. Such expressions include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do. | Warning |
Negated 'if' statement | This inspection reports any instances of if statements in JavaScript content which contain else branches and whose conditions are negated. Flipping the order of the if and else branches will usually increase the clarity of such statements. | Disabled |
Negated conditional expression | This inspection reports any instances of conditional expressions in JavaScript content whose conditions are negated. Flipping the order of the conditional expression branches will usually increase the clarity of such statements. | Disabled |
'break' statement | This inspection reports any break statements in Javascript content. break statements that end case blocks are not reported. | Disabled |
'break' statement with label | This inspection reports any labelled break statements in Javascript content. | Disabled |
'continue' statement | This inspection reports any continue statements in Javascript content. | Disabled |
'continue' statement with label | This inspection reports any labelled continue statements in Javascript content. | Disabled |
'default' not last case in 'switch' | This inspection reports any instances of JavaScript switch statements where the default casecomes before some other case. This construct is unnecessarily confusing. | Disabled |
Unnecessary 'continue' statement | This inspection reports on any unnecessary continue statements at the end of loops, in JavaScript content. These statements may be safely removed. | Warning |
Unnecessary 'return' statement | This inspection reports on any unnecessary return statements in JavaScript functions. Unnecessary return statements are those which return no value and occur just before the function would have "fallen through" to the bottom. These statements may be safely removed. | Warning |
Unnecessary label on 'break' statement | This inspection reports any labelled break statements in Javascript content whose labels may be removed without changing the flow of control. | Warning |
Unnecessary label on 'continue' statement | This inspection reports any labelled continue statements in Javascript content whose labels may be removed without changing the flow of control. | Warning |
Labeled statement | This inspection reports any labeled statements in Javascript content. | Disabled |
'switch' statement with no default branch | This inspection reports any switch statements in Javascript content which lack default branches. Such statements may result in difficult bugs, if unexpected cases are silently ignored | Disabled |
Fallthrough in 'switch' statement | This inspection reports any cases where control can proceed from one branch of a switch statement to the next, in Javascript content. Such "fall-through" is often a result of programmer error. | Warning |
Nested 'switch' statement | This inspection reports any switch statements in Javascript content which are nested in other switch statements. Such nested switch statements can be very confusing, particularly if proper indenting is not followed. | Disabled |
Duplicate condition in 'if' statement | This inspection reports on any duplicate conditions among different branches of an if statement in JavaScript content. While it may rarely be the desired semantics, duplicate conditions usually represent programmer oversight. | Disabled |
Constant conditional expression | This inspection reports any instances of conditional expressions of the form true?result1:result2 or false?result1:result2 .These expressions sometimes occur as the result of automatic refactorings, and may obviously be simplified. | Warning |
Constant 'if' statement | This inspection reports any instances of JavaScript if statements of the form if(true)... or if(false)... .These statements sometimes occur due to automatic refactorings, and may obviouslybe simplified. | Warning |
Conditional expression with identical branches | This inspection reports any instances of ternary conditional expressions with identical "then" and "else" branches in JavaScript content. Such statements are almost certainly programmer error. | Disabled |
'if' statement with identical branches | This inspection reports any instances of if statements with identical "then" and "else" branches in JavaScript content. Such statements are almost certainly programmer error. | Disabled |
'if' statement with too many branches | Disabled | |
Redundant 'if' statement | This inspection reports instances of JavaScript if statements which can be simplified to single assignment or return statements. For example:
if (foo())
{
return true;
}
else
{
return false;
}
return foo();
| Warning |
Redundant conditional expression | This inspection reports any instances of JavaScript conditional expressions of the form condition?true:false or condition?false:true . These expressions may be safely simplified to condition or !condition , respectively. | Warning |
Unnecessary label | This inspection reports any instances of unused labels in JavaScript code. | Warning |
'for' loop where update or condition does not use loop variable | This inspection reports any instances of JavaScript for loops where the condition or update does not use the for loop variable. | Disabled |
Tail recursion | This inspection reports any instances of tail recursion, that is when a JavaScript function calls itselfas its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster.Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably differentperformance characteristics on different environments. | Disabled |
'for' loop may be replaced by 'while' loop | This inspection reports any instances of JavaScript for loopswhich contain neither initialization or update components, and can thus be replaced bysimpler while statements. Use the checkbox below if you wish this inspection to ignore for loops with trivial or non-existent conditions. | Disabled |
Result of assignment used | This inspection reports assignment expressions where the result of the assignment is used in a containing expression. Such assignments are often indications of coding errors such as using = instead of == . Morever, they can result in confusion due to order of operations, as evaluation of the assignment may effect the outer expression in unexpected ways. | Disabled |
Nested assignment | This inspection reports any instances of JavaScript assignment expressions nested inside other expressions. While admirably terse,such expressions may be confusing, and violate the general design priniciple that a given construct should do precisely one thing. | Disabled |
Assignment to function parameter | This inspection reports any instances of assignment to a variable declared as a JavaScript function parameter. It also reports any attempt to increment or decrement the variable. While occasionally intended, this construct can be extremely confusing, and is often the result of a programmer error. | Disabled |
Assignment to 'for' loop parameter | Disabled | |
Assignment replaceable with operator assignment | This inspection reports instances of assignment operations in JavaScript content which can be replaced by operator-assignment. Code using operator assignment may be clearer, and theoretically more performant. | Disabled |
Variable is assigned to itself | This inspection reports any assignments of the form x = x in JavaScript content. These are pointless, and usually indicate programmer error. | Warning |
Text label in 'switch' statement | This inspection reports any instances of labelled statements inside of JavaScript switch statements.While occasionally intended, this construction is often the result of a typo.
switch (x)
{
case 1:
case2: //typo!
case 3:
break ;
}
| Disabled |
Non short-circuit boolean expression | This inspection reports on any uses in JavaScript code of the non-short-circuit forms of boolean 'and' and 'or' ( & and | ). The non-short-circuit versions are occasionally useful, buttheir presence is often due to typos of the short-circuit forms ( && and || ), and may lead to subtle bugs. | Disabled |
Result of object allocation ignored | This inspection reports any instances of JavaScript object allocation where the object allocated ignored.Such allocation expressions are legal JavaScript, but are usually either inadvertant, orevidence of a very odd object initialization strategy. | Disabled |
Divide by zero | This inspection reports any instances of division by zero or remainder by zero in JavaScript code. | Disabled |
Equality operator may cause type coercion | This inspection reports usages of JavaScript equality operators which may cause unexpected type coercions.It is considered a good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and != . Depending on the option selected, this will either highlight:
| Warning |
'debugger' statement | This inspection reports JavaScript 'debugger' statements, used for interaction with Javascript debuggers. Such statements should probably not be found in production code. | Disabled |
Expression statement which is not assignment or call | This inspection reports expression statements which are not assignments or calls. Such statements have no dubious semantics, are normally the result of programmer error. | Warning |
Duplicate case label | This inspection reports any duplicated case labels on JavaScript switch statements. Such switch statements are normally an indication of programmer error. | Warning |
Unreachable code | This inspection reports any instances of JavaScript code which can never be executed. Such code almost certainly represents a programming error | Warning |
Function with inconsistent returns | This inspection reports any instances of JavaScript functions which return a value in some circumstances and return without a value in others. While legal, such code almost certainly represents a programming error | Disabled |
'this' expression which references the global object | This inspection reports instances of JavaScript this expression occuring outside of object literals or constructor bodies. Such this expressions are legal JavaScript, and reference the top-level "global" JavaScript object, but are largely useless. | Warning |
Reserved word used as name | This inspection reports on any uses of JavaScript reserved words being used as a name. The JavaScript specificationreserves a number of words which are currently not used as JavaScript keywords. Using those words as identifiers mayresult in broken code if later versions of JavaScript use them as keywords. | Warning |
String literal which breaks HTML parsing | This inspection reports any instances of JavaScript string literals which contain the sequence '</'. Such strings are legal JavaScript, but may result in incorrect parsing of any HTML the JavaScript is embedded in. | Disabled |
Function naming convention | Disabled | |
Class naming convention | Disabled | |
Local variable naming convention | Disabled | |
Function parameter naming convention | Disabled | |
Use of 'caller' property | This inspection reports on any uses of the caller property in a JavaScript function.Use of this property to access the stack frame of the calling method can be extremely confusing, and result in subtle bugs. | Warning |
Unnecessary 'block' statement | This inspection reports unnecessary block statements in JavaScript content. Block statements that are not used as the body of if , for , while , do , with , or try statements, or as the body of a function declaration are reported. Since JavaScript blocks do not introduce new scopes as is common in Java and other languages, free-standing block statements may be the result of code confusion, and may result in subtle bugs. | Disabled |
Conditional expression | This inspection reports ternary conditional expressions. Some coding standards prohibit such expressions, in favor of explicit if statements. | Disabled |
Comma expression | This inspection reports any instances of JavaScript comma expressions. Comma expressions are often a sign of overly clever code, and may lead to subtle bugs. Comma expressions in the initializer or update section of a for loop are ignored by this inspection. | Warning |
Nested conditional expression | This inspection reports ternary conditional expressions contained within other ternary conditions. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic. | Disabled |
Result of increment or decrement used | This inspection reports increment ( ++ ) or decrement ( -- ) expressions where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to order of operations, as evaluation of the assignment may effect the outer expression in unexpected ways. | Disabled |
'with' statement | This inspection reports any with statements in Javascript content. with statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables. | Warning |
'void' expression | This inspection reports any void expressions in JavaScript statements. Since void behaves completely differently in JavaScript and Java, these expressions maybe confusing. | Disabled |
Overly complex arithmetic expression | Disabled | |
Overly complex boolean expression | Disabled | |
Nested function | This inspection reports JavaScript functions nested inside other functions. While JavaScript allows functions to be nested, such constructs may be confusing. Additionally, nested functions are prone to cause difficult-to-diagnose memory leaks in certain browsers, including Microsoft Internet Explorer. Use the checkbox below to prevent this inspection from reporting anonymous nested functions. | Disabled |
Anonymous function | This inspection reports anonymous JavaScript functions. While often very handy, anonymous functions may be confusing, and are discouraged in some coding standards. | Disabled |
Statement with empty body | This inspection reports instances of JavaScript if , while , for , and with statements whose bodies are empty. While occasionally useful, such statements are often the result of typos, and may cause confusion. Use the checkbox below to select whether statements whose bodies are empty block statements will be reported by this inspection. | Warning |
Octal Integer | This inspection reports any instances of octal integer literals in JavaScript code. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals. | Warning |
Confusing floating point literal | This inspection reports any JavaScript floating point numbers which do not have a decimal point, numbers before the decimal point,and numbers after the decimal point. Such literals may be confusing, and violate several coding standards. | Disabled |
Confusing sequence of '+' or '-' | This inspection reports any suspicions combinations of + or - characters in JavaScript code (e.g. a+++b . While legal, such sequences are confusing, and may have their semantics changed through changes in whitespace. | Disabled |
Execution of dynamically generated JavaScript | This inspection reports on any uses of the eval , setTimeout , setInterval functions, or allocation of a Function object in JavaScript. These functions are used to execute arbitrary strings of JavaScript text, often dynamically generated. This can be very confusing, and may be a security risk. | Disabled |
Magic number | This inspection reports all instances of "magic numbers", literal numeric constants used without declaration, used in JavaScript code."Magic numbers" can result in code whose intention is extremely unclear, and may result in errors if a "magicnumber" is changed in one code location but not another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0.0 and 1.0 are not reported by this inspection. | Disabled |
Empty 'catch' block | This inspection reports any empty catch blocks in Javascript content. Empty catch blocks are a sign that errors are simply being ignored, rather than properly handled. | Disabled |
Empty 'try' block | This inspection reports any empty try blocks in Javascript content. Empty try is usually the result of a coding error. | Disabled |
Empty 'finally' block | This inspection reports any empty finally blocks in Javascript content. Empty finally are usually the result of a coding error. | Disabled |
'return' inside 'finally' block | This inspection reports any instances of return statements inside of finally blocks in JavaScript content. While occasionally intended, such return statements may mask exceptions thrown, and tremendously complicate debugging. | Warning |
'throw' inside 'finally' block | This inspection reports any instances of throw statements inside of finally blocks. While occasionally intended, such throw statements may mask exceptions thrown, and tremendously complicate debugging. | Warning |
'continue' or 'break' inside 'finally' block | This inspection reports any instances of break or continue statements inside of finally blocks. While occasionally intended, such statements are very confusing, may mask exceptions thrown, and tremendously complicate debugging. | Warning |
Exception used for local control-flow | This inspection reports any instances of JavaScript throw statements whose exceptions are always caught by containing try statements. Using throw statements as a "goto" to change the local flow of control is likely to be confusing. | Warning |
Unused 'catch' parameter | This inspection reports any JavaScript catch parameters that are unused in theircorresponding blocks. This inspection will not report any catch parametersnamed "ignore" or "ignored". Use the checkbox below to disable this inspection for catch blocks with comments. | Disabled |
Constant on left side of comparison | This inspection reports on comparison operations with constant values on their left-hand side. Some coding conventions specify that constants should be on the right-hand side of comparisons. | Disabled |
Chained equality | This inspection reports any instances of chained equality comparisons (i.e. a==b==c ) in JavaScript code. Such comparisons are confusing. | Disabled |
Chained function call | This inspection reports any JavaScript function calls whose target is another function call. | Disabled |
Nested function call | This inspection reports any JavaScript function calls used as arguments to another function call. | Disabled |
Constant on right side of comparison | This inspection reports on comparison operations with constant values on their right-hand side. Some coding conventions specify that constants should be on the left-hand side of comparisons. | Disabled |
Unterminated statement | This inspection reports Javascript statements that may be erroneously not terminated by a semicolon or a newline. If 'terminate statements with semicolons' is selected in code style settings, reports all statements which do not end with a semicolon. While line-breaks may be used instead of semicolons to terminate JavaScript statements, some coding styles prefer the semicolon for consistency with the other languages. | Warning |
Non-block statement body | This inspection reports instances of JavaScript if , while , for , and with statements whose bodies are not block statements. While such statements are legal JavaScript, it is usually safer for downstream maintenance to use the code blocks for statement bodies. | Disabled |
Overly nested function | Disabled | |
Function with more than three negations | This inspection reports JavaScript functions with three or more negation operations ( ! or != ). Such functions may be unnecessarily confusing. | Disabled |
Function with multiple loops | This inspection reports any instances of JavaScript functions containing multiple loop statements. | Disabled |
Function with multiple return points | This inspection reports any instances of JavaScript functions have multiple return points. Some coding standards warn against functions with multiple returns, as they may make functions more difficult to understand and maintain. | Disabled |
Overly complex function | Disabled | |
Function with too many parameters | Disabled | |
Overly long function | Disabled | |
Redundant local variable | This inspection reports any instances of unnecessary JavaScript local variables, which addnothing to the comprehensibility of a function. Variables caught include local variableswhich are immediately returned, local variables that are immediately assigned to anothervariable and then not used, and local variables which always have the same value as anotherlocal variable or parameter. Use the checkbox below to have this inspection ignore variables which are immediatelyreturned or thrown. Some coding styles suggest using such variables for clarity andease of debugging. | Warning |
Reuse of local variable | This inspection reports any instances where JavaScript local variables are "reused", overwriting theirvalues with new values unrelated to their original use. Such local variable reuse may be confusing,as the intended semantics of the local variable may vary with each use. It may also beprone to bugs, if code changes result in values that were thought to be overwritten actuallybeing live. It is good practices to keep variable lifetimes as short as possible, and notreuse local variables for the sake of brevity. | Disabled |
Pointless bitwise expression | This inspection reports any instances of pointless bitwiseexpressions in JavaScript. Such expressions include and ing with zero, ori ng by zero,and shift by zero. Such expressions may be the result of automated refactoringsnot completely followed through to completion, and in any case are unlikely to be what the developerintended to do. | Warning |
Shift operation by inappropriate constant | This inspection reports any instances of JavaScript shift operationswhere the value shifted by is constant and outside of the reasonable range. Integershift operations outside of the range 0..31 are reported. Shifting by negative or overly large values is almost certainlya coding error. | Warning |
Incompatible bitwise mask operation | This inspection reports any instances of JavaScript bitwise mask expressions which are guaranteed toevaluate to true or false in JavaScript code.Expressions checked are of the form (var & constant1) == constant2 or (var | constant1) == constant2 , where constant1 and constant2 are incompatible bitmask constants. | Warning |
Method can be static | Checks for ActionScript and TypeScript functions that can be static. | Warning |
Validate file references | Reports unresolved file references in JavaScript files, including CommonJS and AMD modules references. | Warning |
Typeof comparing with non-standard value | The inspection reports when literal string in a comparing with typeof is not one of the standard types:"undefined", "object", "boolean", "number", "string", "function", "symbol" | Warning |
Missing AMD module dependency | Inside an AMD module definition, checks that all used modules are specified as dependencies. Suggests inserting the module dependency. Works only in files in the scope of "HTML" JavaScript library. | Weak warning |
Missing import statement | Checks that all modules are referenced through import statements. Suggests inserting the import statement. When using libraries that define their own global symbols outside their visible JavaScript code (e.g. | Weak warning |
Identifiers with non-ASCII symbols | Reports names containing non-ASCII symbols. | Warning |
Referencing 'arguments' outside of function | Checks that 'arguments' are referenced only in function body. | Error |
Missing module dependency | Checks whether the module in the "require()" call or import statement exists, whether it is listed in package.json dependencies, and whether it is locally installed. Suggests installing the module and/or including it into package.json. For require() calls, works only in files in the scope of "Node.js Core" JavaScript library. | Weak warning |
Unresolved Ext JS xtype | Checks that Ext JS xtype references have corresponding class. | Warning |
Non-strict mode used | Checks that JavaScript files are in strict mode. | Disabled |
Flow errors | Reports errors from Flow in Inspect code. | Disabled |
Missing .flowconfig | Checks that there’s a .flowconfig file in the project that covers a JavaScript file with the | Warning |
Code is not covered by Flow | Checks that JavaScript code is covered by the Flow type checker. To use this inspection, the Flow executable must be configured in Settings | Languages & Frameworks | JavaScript | Disabled |
Flow flag is misplaced | Checks that the | Warning |
Validate webpack configuration | Validates options in the webpack configuration file (which name should start with `webpack`, e.g. `webpack.config.js`)against webpack Options Schema. | Warning |
Mismatched dependencies in package.json | Reports dependencies in package.json that are not installed or don't match the specified version range. | Warning |
Karma configuration file | Reports possible errors in file paths ('basePath', 'files') for *.conf.js files. | Warning |
Coding assistance for Node.js core modules | Suggests configuring coding assistance for Node.js core modules. | Warning |
Missing require() statement | Checks that all modules are referenced through "require()". Suggests inserting the "require()" call. Works only in files in the scope of "Node.js Core" JavaScript library. When using libraries that define their own global symbols outside their visible JavaScript code (e.g. | Weak warning |