Showing 5 of 5 total issues
Function processString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
JSCSFilter.prototype.processString = function(content, relativePath) {
if (this.enabled && !this.bypass) {
if (this.shouldExcludeFile(relativePath)) {
return this.disableTestGenerator ? content : '';
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function lintTree
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
lintTree: function(type, tree) {
var jscsOptions = this.app.options.jscsOptions || {};
if (!jscsOptions.enabled) {
return tree;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function shouldExcludeFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
JSCSFilter.prototype.shouldExcludeFile = function(relativePath) {
if (this.rules.excludeFiles) {
// The user specified an "excludeFiles" list.
// Must pattern match or find a cache hit to determine if this relativePath is an actual JSCS exclusion.
var excludeFileCache = this._excludeFileCache;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function configure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
JSCSFilter.prototype.configure = function () {
if (this.enabled) {
this.rules = this.loadRules(this.inputPaths[0]);
this.bypass = Object.keys(this.rules).length === 0;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function JSCSFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var JSCSFilter = function(inputTree, _options) {
if (!(this instanceof JSCSFilter)) { return new JSCSFilter(inputTree, _options); }
var options = _options || {};
if (!options.hasOwnProperty('persist')) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"