Showing 7 of 20 total issues
Function isValid
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
var isValid = function (command) {
// create async process here for validation
var deferred = Q.defer();
// get domain name
- 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 execute
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var execute = function (items) {
// create defer process
var deferred = Q.defer();
// default internal process for progressive load
Function internalProcess
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var internalProcess = function (items) {
// default result
var report = { title : '', result : [] };
// data is not undefined ?
if (!_.isUndefined(items)) {
Function isValid
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var isValid = function (command) {
// create async process here for validation
var deferred = Q.defer();
// get domain name
Function timeout
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var timeout = setTimeout(function () {
// remove timeout
clearTimeout(timeout);
// checkif configuration file exists and if format is valid
fs.stat(command.config.scenario, function (error, stats) {
Function exportReport
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var exportReport = function (report, toFile, filePath, last) {
// create defere process
var deferred = Q.defer();
// is not last item ?
Function populate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
var populate = function () {
// create defer process
var deferred = Q.defer();
// has valid value ?
if (_.has(storeConfig, 'config') && !_.isEmpty(storeConfig.config)) {
- 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"