Showing 12 of 18 total issues
Function exports
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (function() {
/**
* Object to add properties description to file or folder. Methods
* to add and list mime types.
*
- 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 exports
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function() {
/**
* Object to add properties description to file or folder. Methods
* to add and list mime types.
*
- Create a ticketCreate a ticket
File local.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
/**
*
* ----------------------------------------------------------------------------
- Create a ticketCreate a ticket
Function merge
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
module.exports.merge = function merge() {
var dst = {}, src, p, args = [].splice.call(arguments, 0);
var toString = Object.prototype.toString;
- 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 open
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Local.prototype.open = function(relative, next) {
var self = this,
directory = path.resolve(this.home, path.join(this.home, relative));
try {
- Create a ticketCreate a ticket
Function _stat
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_stat: function(filepath) {
var result = {
name : path.basename(filepath),
path : filepath,
- Create a ticketCreate a ticket
Function remove
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Local.prototype.remove = function(relative, next) {
var absolute = path.resolve(this.home, path.join(this.home, relative)),
self = this;
try {
- Create a ticketCreate a ticket
Function copy
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Local.prototype.copy = function(src, dst, next) {
var from = path.resolve(this.home, path.join(this.home, src)),
to = path.resolve(this.home, path.join(this.home, dst)),
self = this;
- Create a ticketCreate a ticket
Function add
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Local.prototype.add = function(src, to, next) {
var self = this,
basename = path.basename(src, path.extname(src)),
filename = S(basename).slugify().s;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (toString.call(src[p]) === '[object Object]') {
dst[p] = merge(dst[p] || {}, src[p]);
} else {
dst[p] = src[p];
}
- Create a ticketCreate a ticket
Function open
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Local.prototype.open = function(relative, next) {
var self = this,
directory = path.resolve(this.home, path.join(this.home, relative));
try {
- 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 remove
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Local.prototype.remove = function(relative, next) {
var absolute = path.resolve(this.home, path.join(this.home, relative)),
self = this;
try {
- 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"