catdad/grandma

View on GitHub

Showing 47 of 64 total issues

Function interactiveRun has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function interactiveRun() {
    var start = Date.now();
    var reportCount = 0;
    var write = writer('interactive');
    
Severity: Minor
Found in examples/runtime-adjustment-rate.js - About 1 hr to fix

    Function boxplotReporter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.box = function boxplotReporter(opts, done) {
    
            var input = opts.input;
            var output = opts.output;
    
    
    Severity: Minor
    Found in lib/report.js - About 1 hr to fix

      Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function() {
          var bins = {};
      
          var api = {};
      
      
      Severity: Minor
      Found in lib/estimate-concurrent.js - About 45 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 validateDurationProp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function validateDurationProp(opts, prop, required) {
          var val = opts[prop];
          var isValidString = _.isString(val) && /\d+(ms|[smhdw])$/.test(val);
          var isNumber = _.isNumber(val);
      
      
      Severity: Minor
      Found in lib/run.js - About 35 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 validateOpts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function validateOpts(options) {
          // really, this should be using garry,
          // but it is not written yet
      
          var objectMode = false;
      Severity: Minor
      Found in lib/run.js - About 35 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 getWidth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function getWidth() {
          var isatty = tty.isatty(1) && tty.isatty(2);
      
          if (isatty) {
              window.width = process.stdout.getWindowSize ?
      Severity: Minor
      Found in lib/tty-helper.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function() {
          var start = Infinity;
          var end = -Infinity;
          var result = 0;
      
      
      Severity: Minor
      Found in lib/estimate-duration.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