Showing 22 of 26 total issues
File Nlint.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
var fs = require( 'fs' ),
async = require( 'async' ),
JSON5 = require( 'json5' ),
child_process = require( 'child_process' ),
rstartslash = /^\//,
Function update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
update: function( settings, root ) {
var self = this, list = [];
root = root || process.cwd();
settings = settings || {};
- 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 each
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
each: function( items, fn ) {
var i, l;
if ( Nlint.isNumber( items ) ) {
for ( i = -1; ++i < items; ) {
- 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 render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function( path, contents, settings, callback ) {
var errors = [],
checker = new JSCS(),
results = [],
lines = contents.trim().split( rnewline ),
Function update
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function( settings, root ) {
var self = this, list = [];
root = root || process.cwd();
settings = settings || {};
Function Linter
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Linter( path ) {
var self = this, result, settings,
current = Nlint.Linters.filter(function( linter ) {
return linter.path === path;
});
Function extend
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Nlint.extend = function(){
var args = Slice.call( arguments ), i = -1, l = args.length, deep = false, target = this, name, copy;
// Check for deep copy
if ( Nlint.isBoolean( args[ 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 run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
run: function( callback ) {
var self = this;
// Start processing each file
async.each(
Function Linter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function Linter( path ) {
var self = this, result, settings,
current = Nlint.Linters.filter(function( linter ) {
return linter.path === path;
});
- 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 _runLint
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_runLint: function( result, settings, linter, callback ){
var self = this,
// We have to create a copy of the options used for each linter in case
// the linter itself alters the options
Function finished
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
finished: function( e ) {
var self = this,
passed = false,
warn = false,
error = false;
Function forks
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
forks: function(){
var self = this;
if ( self._forks.length ) {
return;
Function regexPath
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
regexPath: (function(){
var rdot = /\./g,
rstar = /\*/g,
rquot = /'/g,
rdquot = /"/g,
Function _renderNodelint
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderNodelint: function( path, callback ) {
var self = this;
// Read contents and store them
fs.stat( path, function( e, stat ) {
Function Nlint
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Nlint( files, options, callback ) {
var self = this;
// Force Nlint instance
if ( ! ( self instanceof Nlint ) ) {
Function passed
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
passed: function(){
var self = this;
self.lint.results
.sort(function( a, b ) {
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render: function( path, contents, settings, callback ) {
var errors = [],
checker = new JSCS(),
results = [],
lines = contents.trim().split( rnewline ),
- 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 finished
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
finished: function( e ) {
var self = this,
passed = false,
warn = false,
error = false;
- 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 Nlint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function Nlint( files, options, callback ) {
var self = this;
// Force Nlint instance
if ( ! ( self instanceof Nlint ) ) {
- 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 _runLint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_runLint: function( result, settings, linter, callback ){
var self = this,
// We have to create a copy of the options used for each linter in case
// the linter itself alters the options
- 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"