broadsw0rd/enhanced-log

View on GitHub

Showing 86 of 86 total issues

File mocha.js has 3373 lines of code (exceeds 250 allowed). Consider refactoring.
Open

;(function(){

// CommonJS require()

function require(p){
Severity: Major
Found in libs/mocha.js - About 1 wk to fix

    Function factory has 296 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    }('log', this, function factory(){
    
    return function scope(global, Object, Array, prototype, __proto__){
    
        // =====================================
    Severity: Major
    Found in src/log.js - About 1 day to fix

      Function scope has 294 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      return function scope(global, Object, Array, prototype, __proto__){
      
          // =====================================
          // Private interface
          // =====================================
      Severity: Major
      Found in src/log.js - About 1 day to fix

        Function JsDiff has 290 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var JsDiff = (function() {
          /*jshint maxparams: 5*/
          function clonePath(path) {
            return { newPos: path.newPos, components: path.components.slice(0) };
          }
        Severity: Major
        Found in libs/mocha.js - About 1 day to fix

          Function factory has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
          Open

          }('log', this, function factory(){
          
          return function scope(global, Object, Array, prototype, __proto__){
          
              // =====================================
          Severity: Minor
          Found in src/log.js - About 1 day 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

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          Suite.prototype.afterAll = function(title, fn){
            if (this.pending) return this;
            if ('function' === typeof title) {
              fn = title;
              title = fn.name;
          Severity: Major
          Found in libs/mocha.js and 3 other locations - About 1 day to fix
          libs/mocha.js on lines 5362..5379
          libs/mocha.js on lines 5416..5433
          libs/mocha.js on lines 5443..5460

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 211.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          Suite.prototype.afterEach = function(title, fn){
            if (this.pending) return this;
            if ('function' === typeof title) {
              fn = title;
              title = fn.name;
          Severity: Major
          Found in libs/mocha.js and 3 other locations - About 1 day to fix
          libs/mocha.js on lines 5362..5379
          libs/mocha.js on lines 5389..5406
          libs/mocha.js on lines 5416..5433

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 211.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          Suite.prototype.beforeEach = function(title, fn){
            if (this.pending) return this;
            if ('function' === typeof title) {
              fn = title;
              title = fn.name;
          Severity: Major
          Found in libs/mocha.js and 3 other locations - About 1 day to fix
          libs/mocha.js on lines 5362..5379
          libs/mocha.js on lines 5389..5406
          libs/mocha.js on lines 5443..5460

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 211.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          Suite.prototype.beforeAll = function(title, fn){
            if (this.pending) return this;
            if ('function' === typeof title) {
              fn = title;
              title = fn.name;
          Severity: Major
          Found in libs/mocha.js and 3 other locations - About 1 day to fix
          libs/mocha.js on lines 5389..5406
          libs/mocha.js on lines 5416..5433
          libs/mocha.js on lines 5443..5460

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 211.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function HTML has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function HTML(runner) {
            Base.call(this, runner);
          
            var self = this
              , stats = this.stats
          Severity: Major
          Found in libs/mocha.js - About 3 hrs to fix

            File log.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
                ______      __                              __   __               
               / ____/___  / /_  ____ _____  ________  ____/ /  / /   ____  ____ _
              / __/ / __ \/ __ \/ __ `/ __ \/ ___/ _ \/ __  /  / /   / __ \/ __ `/
             / /___/ / / / / / / /_/ / / / / /__/  __/ /_/ /  / /___/ /_/ / /_/ / 
            Severity: Minor
            Found in src/log.js - About 3 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                on(passesLink, 'click', function(){
                  unhide();
                  var name = /pass/.test(report.className) ? '' : ' pass';
                  report.className = report.className.replace(/fail|pass/g, '') + name;
                  if (report.className.trim()) hideSuitesWithout('test pass');
              Severity: Major
              Found in libs/mocha.js and 1 other location - About 2 hrs to fix
              libs/mocha.js on lines 2688..2693

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                on(failuresLink, 'click', function(){
                  unhide();
                  var name = /fail/.test(report.className) ? '' : ' fail';
                  report.className = report.className.replace(/fail|pass/g, '') + name;
                  if (report.className.trim()) hideSuitesWithout('test fail');
              Severity: Major
              Found in libs/mocha.js and 1 other location - About 2 hrs to fix
              libs/mocha.js on lines 2680..2685

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function createPatch has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
                    var ret = [];
              
                    ret.push('Index: ' + fileName);
                    ret.push('===================================================================');
              Severity: Major
              Found in libs/mocha.js - About 2 hrs to fix

                Function run has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Runnable.prototype.run = function(fn){
                  var self = this
                    , start = new Date
                    , ctx = this.ctx
                    , finished
                Severity: Major
                Found in libs/mocha.js - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  Runnable.prototype.slow = function(ms){
                    if (0 === arguments.length) return this._slow;
                    if ('string' == typeof ms) ms = milliseconds(ms);
                    debug('timeout %d', ms);
                    this._slow = ms;
                  Severity: Major
                  Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                  libs/mocha.js on lines 5331..5337

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 87.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  Suite.prototype.slow = function(ms){
                    if (0 === arguments.length) return this._slow;
                    if ('string' == typeof ms) ms = milliseconds(ms);
                    debug('slow %d', ms);
                    this._slow = ms;
                  Severity: Major
                  Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                  libs/mocha.js on lines 4329..4335

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 87.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function Markdown has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Markdown(runner) {
                    Base.call(this, runner);
                  
                    var self = this
                      , stats = this.stats
                  Severity: Major
                  Found in libs/mocha.js - About 2 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        context.suite.skip = function(title, fn) {
                          var suite = Suite.create(suites[0], title);
                          suite.pending = true;
                          suites.unshift(suite);
                          fn.call(suite);
                    Severity: Major
                    Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                    libs/mocha.js on lines 1012..1018

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 83.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        context.test.only = function(title, fn){
                          var test = context.test(title, fn);
                          var reString = '^' + escapeRe(test.fullTitle()) + '$';
                          mocha.grep(new RegExp(reString));
                        };
                    Severity: Major
                    Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                    libs/mocha.js on lines 1253..1257

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 83.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language