Showing 48 of 133 total issues
File test.js
has 1910 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-env mocha */
/* eslint-disable no-undefined */
'use strict'
Function namingConvention
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
var namingConvention = function( line ) {
var arr = this.splitAndStrip( ' ', line )
// determine if line should be tested at all
var doWeTestRe = /^[${:]+/m
var badConvention = 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 setConfig
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
var setConfig = function( configpath ) {
var files = []
var customPath = ''
// return default config if nothing passed in or found
var returnConfig
- 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 brackets
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
var brackets = function( line ) {
// in order if:
// 1 in hash or css block
// 2 variable or hash or block
// 3 mixin
- 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 lint
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
var lint = function() {
var method = ''
var checks = Object.getPrototypeOf( this ).lintMethods
var maxErrs = typeof this.config.maxErrors === 'number' ? this.config.maxErrors : false
var maxWarnings = typeof this.config.maxWarnings === 'number' ? this.config.maxWarnings : 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 setConfig
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setConfig = function( configpath ) {
var files = []
var customPath = ''
// return default config if nothing passed in or found
var returnConfig
Function efficient
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
var efficient = function( line ) {
// line doesnt have margin or padding then there's nothin to do here
if ( !valueRe.test( line ) ) { return }
var isEfficient = true
- 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 sortOrder
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sortOrder = function( line ) {
// we don't alphabetize the root yet
if ( this.state.context === 0 || this.state.hash ) {
this.cache.sortOrderCache = []
return
Function Stylint
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
var Stylint = function( path, config, callback ) {
return stampit().compose(
require( './src/core/' ),
require( './src/checks/' ),
require( './src/state/' ),
- 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 done
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var done = function() {
var warningsOrErrors = []
var msg = ''
var groupedByFile = {}
var msgGrouped
Function brackets
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var brackets = function( line ) {
// in order if:
// 1 in hash or css block
// 2 variable or hash or block
// 3 mixin
Function namingConvention
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
var namingConvention = function( line ) {
var arr = this.splitAndStrip( ' ', line )
// determine if line should be tested at all
var doWeTestRe = /^[${:]+/m
var badConvention = false
Function setState
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var setState = function( line ) {
this.state.context = this.setContext( this.cache.line )
// ignore the current line if @stylint ignore
if ( this.cache.origLine.indexOf( '@stylint ignore' ) !== -1 ) {
- 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 done
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
var done = function() {
var warningsOrErrors = []
var msg = ''
var groupedByFile = {}
var msgGrouped
- 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 reporter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var reporter = function( msg, done, kill ) {
if ( done === 'done' ) {
// total errors
this.cache.msg = 'Stylint: ' + this.cache.errs.length + ' Errors.'
this.cache.msg += this.config.maxErrors ? ' (Max Errors: ' + this.config.maxErrors + ')' : ''
- 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 duplicates
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var duplicates = function( line ) {
var arr = this.splitAndStrip( new RegExp( /[\s\t]/ ), line )
var dupe = false
var dupeIndex
var origFile
Function sortOrder
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var sortOrder = function( line ) {
// we don't alphabetize the root yet
if ( this.state.context === 0 || this.state.hash ) {
this.cache.sortOrderCache = []
return
- 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 quotePref
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var quotePref = function( line, origLine ) {
if ( origLine.indexOf( '"' ) === -1 &&
origLine.indexOf( "'" ) === -1 ) {
return
}
- 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 Stylint
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Stylint = function( path, config, callback ) {
return stampit().compose(
require( './src/core/' ),
require( './src/checks/' ),
require( './src/state/' ),
Function valid
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function valid( line ) {
// from and to are valid keyframes properties, but not outside that context
if ( !this.state.keyframes && line.match( keyRe ) ) { return }
// 1 split by tabs and spaces, tabs mess with pattern matching