Function addResource
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
addResource: function(pathToInspect, file, callback) {
if ((file.match(/.+\.js$/g) !== null || file.match(/.+\.es6$/g) !== null) && this.Class.excludedFiles.indexOf(file) === -1) {
var folders = pathToInspect.split(path.sep)
, name = file.replace('.js', '').replace('.es6', '')
, currentFolder = null
- Read upRead up
- Create a ticketCreate a ticket
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 addResource
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
addResource: function(pathToInspect, file, callback) {
if ((file.match(/.+\.js$/g) !== null || file.match(/.+\.es6$/g) !== null) && this.Class.excludedFiles.indexOf(file) === -1) {
var folders = pathToInspect.split(path.sep)
, name = file.replace('.js', '').replace('.es6', '')
, currentFolder = null
- Create a ticketCreate a ticket
Function extend
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
extend: function() {
var Reg = new RegExp('.*\\(([^\\)]+)\\:.*\\:.*\\)', 'ig')
, stack = new Error().stack.split('\n')
, extendingArgs = [].slice.call(arguments)
, Static = (extendingArgs.length === 2) ? extendingArgs.shift() : {}
- Create a ticketCreate a ticket
Function addFolderToPath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
addFolderToPath: function(injector, folder) {
var folderPath = path.join(this.path, folder)
, folders = folder.split('/')
, currentFolder = null
, rootFolder = null
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if (rootFolder === null) {
rootFolder = currentFolder;
if (this[ rootFolder ] !== undefined ) {
lastFolder = this[ rootFolder ];
}
- Create a ticketCreate a ticket
Function extend
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
extend: function() {
var Reg = new RegExp('.*\\(([^\\)]+)\\:.*\\:.*\\)', 'ig')
, stack = new Error().stack.split('\n')
, extendingArgs = [].slice.call(arguments)
, Static = (extendingArgs.length === 2) ? extendingArgs.shift() : {}
- Read upRead up
- Create a ticketCreate a ticket
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"