whyboris/karma-helpful-reporter

View on GitHub

Showing 9 of 13 total issues

Function DrawUtil has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DrawUtil() {

  var width = Math.ceil(shell.getWidth() * 0.7) | 0;
  this.tick = 0;

Severity: Major
Found in lib/util/draw.js - About 2 hrs to fix

    Function Helpful has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Helpful(baseReporterDecorator, formatError, config) {
      var self = this;
      var defaultOptions = function() {
        return {
          animationStyle: 'braille',
    Severity: Major
    Found in lib/helpful.js - About 2 hrs to fix

      Function DrawUtil has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      function DrawUtil() {
      
        var width = Math.ceil(shell.getWidth() * 0.7) | 0;
        this.tick = 0;
      
      
      Severity: Minor
      Found in lib/util/draw.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 toString has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Browser.prototype.toString = function() {
        var depth = this.depth;
        var linesPrinted = 0;
        var out = [];
      
      
      Severity: Minor
      Found in lib/data/types.js - About 1 hr to fix

        Function onSpecComplete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Helpful.prototype.onSpecComplete = function(browser, result) {
          // don't pollute original object
          this.stats = Object.create(browser.lastResult);
        
          // sum up tests stats
        Severity: Minor
        Found in lib/helpful.js - About 1 hr to fix

          Function ShellUtility has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var ShellUtility = function() {
            var self = this;
            var winSize = useStdout ? stdout.getWindowSize(1) : [75, 4];
          
            this.getWidth = function() {
          Severity: Minor
          Found in lib/util/shell.js - About 1 hr to fix

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

              function printBrowserErrors(browserErrors) {
                if (browserErrors)  {
                  var hashes = '##########'.split('');
                  var rainbowifyEach = function(val) {
                    write(val);
            Severity: Minor
            Found in lib/util/printers.js - About 1 hr to fix

              Function Helpful has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function Helpful(baseReporterDecorator, formatError, config) {
                var self = this;
                var defaultOptions = function() {
                  return {
                    animationStyle: 'braille',
              Severity: Minor
              Found in lib/helpful.js - About 55 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 saveResultToSuite has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              DataStore.prototype.saveResultToSuite = function(suite, browser, result) {
                suite.tests = (!suite.tests) ? [] : suite.tests;
                var test = this.findTestByName(suite.tests, result.description);
                test.depth = suite.depth + 1;
              
              
              Severity: Minor
              Found in lib/data/store.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

              Severity
              Category
              Status
              Source
              Language