g13013/broccoli-compass

View on GitHub

Showing 6 of 6 total issues

Function moveToDest has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

function moveToDest(srcDir, destDir) {
  if (!this.options.cleanOutput) {
    return srcDir;
  }
  var content, cssDir, src;
Severity: Minor
Found in index.js - About 2 hrs 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 walkCachedSync has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function walkCachedSync(baseDir, options) {
  baseDir = baseDir || '.';
  options = options || {};
  var file, sub, oldHash;
  var cache = options.cache && options.cache.paths || {};
Severity: Minor
Found in lib/walk_cached_sync.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 moveToDest has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function moveToDest(srcDir, destDir) {
  if (!this.options.cleanOutput) {
    return srcDir;
  }
  var content, cssDir, src;
Severity: Minor
Found in index.js - About 1 hr to fix

    Function walkCachedSync has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function walkCachedSync(baseDir, options) {
      baseDir = baseDir || '.';
      options = options || {};
      var file, sub, oldHash;
      var cache = options.cache && options.cache.paths || {};
    Severity: Minor
    Found in lib/walk_cached_sync.js - About 1 hr to fix

      Function CompassCompiler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function CompassCompiler(inputTree, files, options) {
        options = arguments.length > 2 ? (options || {}) : (files || {});
        if (arguments.length > 2) {
          console.log('[broccoli-compass] DEPRECATION: passing files to broccoli-compass constructor as second parameter is deprecated, ' +
                      'use options.files instead');
      Severity: Minor
      Found in index.js - About 25 mins 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 generateCmdLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      CompassCompiler.prototype.generateCmdLine = function () {
        var value;
        var filtredOptions = {};
        var options = this.options;
        var cmd = [options.compassCommand, 'compile'];
      Severity: Minor
      Found in index.js - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language