MobileFirstLLC/extension-cli

View on GitHub

Showing 3 of 7 total issues

Function keyReplace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    keyReplace(child, parent) {
        for (let key in child) {
            if (!child.hasOwnProperty(key)) continue;
            if (Array.isArray(child[key])) {
                parent[key] = child[key];
Severity: Minor
Found in cli/utilities.js - About 1 hr to fix

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 iterateConfigs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    iterateConfigs(defaultConfig, projectConfig) {
        if (!projectConfig) return defaultConfig;
        let temp = Object.assign({}, defaultConfig);

        for (let k in projectConfig) {
Severity: Minor
Found in cli/utilities.js - About 1 hr to fix

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

Consider simplifying this complex logical expression.
Open

        if ((line.indexOf('.idea') > -1 && !idea) ||
            (line.indexOf('.vscode') > -1 && !vscode) ||
            (line.indexOf('node_modules') > -1 && !modules)) {
            return false;
        }
Severity: Major
Found in cli/xt-clean.js - About 40 mins to fix
    Severity
    Category
    Status
    Source
    Language