broadsw0rd/enhanced-log

View on GitHub
libs/mocha.js

Summary

Maintainability
F
1 mo
Test Coverage

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 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 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

        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

            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

              Function exports has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(suite){
                var suites = [suite];
              
                suite.on('pre-require', function(context, file, mocha){
              
              
              Severity: Major
              Found in libs/mocha.js - About 2 hrs to fix

                Function canonicalize has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                exports.canonicalize = function(value, stack) {
                  var canonicalizedObj,
                    type = exports.type(value),
                    prop,
                    withStack = function withStack(value, fn) {
                Severity: Major
                Found in libs/mocha.js - About 2 hrs to fix

                  Function runTests has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Runner.prototype.runTests = function(suite, fn){
                    var self = this
                      , tests = suite.tests.slice()
                      , test;
                  
                  
                  Severity: Major
                  Found in libs/mocha.js - About 2 hrs to fix

                    Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(suite){
                      var suites = [suite];
                    
                      suite.on('pre-require', function(context, file, mocha){
                    
                    
                    Severity: Minor
                    Found in libs/mocha.js - About 2 hrs to fix

                      Function diff has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            diff: function(oldString, newString) {
                              // Handle the identity case (this is due to unrolling editLength == 0
                              if (newString === oldString) {
                                return [{ value: newString }];
                              }
                      Severity: Minor
                      Found in libs/mocha.js - About 1 hr to fix

                        Function applyPatch has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            applyPatch: function(oldStr, uniDiff) {
                              var diffstr = uniDiff.split('\n');
                              var diff = [];
                              var remEOFNL = false,
                                  addEOFNL = false;
                        Severity: Minor
                        Found in libs/mocha.js - About 1 hr to fix

                          Function Spec has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function Spec(runner) {
                            Base.call(this, runner);
                          
                            var self = this
                              , stats = this.stats
                          Severity: Minor
                          Found in libs/mocha.js - About 1 hr to fix

                            Function Progress has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Progress(runner, options) {
                              Base.call(this, runner);
                            
                              var self = this
                                , options = options || {}
                            Severity: Minor
                            Found in libs/mocha.js - About 1 hr to fix

                              Function exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function(suite){
                                var suites = [suite];
                              
                                suite.on('pre-require', function(context, file, mocha){
                              
                              
                              Severity: Minor
                              Found in libs/mocha.js - About 1 hr to fix

                                Function Base has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function Base(runner) {
                                  var self = this
                                    , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 }
                                    , failures = this.failures = [];
                                
                                
                                Severity: Minor
                                Found in libs/mocha.js - About 1 hr to fix

                                  Function Landing has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function Landing(runner) {
                                    Base.call(this, runner);
                                  
                                    var self = this
                                      , stats = this.stats
                                  Severity: Minor
                                  Found in libs/mocha.js - About 1 hr to fix

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

                                    exports.lookupFiles = function lookupFiles(path, extensions, recursive) {
                                      var files = [];
                                      var re = new RegExp('\\.(' + extensions.join('|') + ')$');
                                    
                                      if (!exists(path)) {
                                    Severity: Minor
                                    Found in libs/mocha.js - About 1 hr to fix

                                      Function list has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      exports.list = function(failures){
                                        console.log();
                                        failures.forEach(function(test, i){
                                          // format
                                          var fmt = color('error title', '  %s) %s:\n')
                                      Severity: Minor
                                      Found in libs/mocha.js - About 1 hr to fix

                                        Function Doc has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function Doc(runner) {
                                          Base.call(this, runner);
                                        
                                          var self = this
                                            , stats = this.stats
                                        Severity: Minor
                                        Found in libs/mocha.js - About 1 hr to fix

                                          Function exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          module.exports = function(suite){
                                            var suites = [suite];
                                          
                                            suite.on('require', visit);
                                          
                                          
                                          Severity: Minor
                                          Found in libs/mocha.js - About 1 hr to fix

                                            Function XUnit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            function XUnit(runner, options) {
                                              Base.call(this, runner);
                                              var stats = this.stats
                                                , tests = []
                                                , self = this;
                                            Severity: Minor
                                            Found in libs/mocha.js - About 1 hr to fix

                                              Function NyanCat has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                              function NyanCat(runner) {
                                                Base.call(this, runner);
                                                var self = this
                                                  , stats = this.stats
                                                  , width = Base.window.width * .75 | 0
                                              Severity: Minor
                                              Found in libs/mocha.js - About 1 hr to fix

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

                                                  function next(err, errSuite) {
                                                    // if we bail after first err
                                                    if (self.failures && suite._bail) return fn();
                                                
                                                    if (self._abort) return fn();
                                                Severity: Minor
                                                Found in libs/mocha.js - About 1 hr to fix

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

                                                  Runner.prototype.runSuite = function(suite, fn){
                                                    var total = this.grepTotal(suite)
                                                      , self = this
                                                      , i = 0;
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in libs/mocha.js - About 1 hr to fix

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

                                                    function TAP(runner) {
                                                      Base.call(this, runner);
                                                    
                                                      var self = this
                                                        , stats = this.stats
                                                    Severity: Minor
                                                    Found in libs/mocha.js - About 1 hr to fix

                                                      Function visit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                        function visit(obj, file) {
                                                          var suite;
                                                          for (var key in obj) {
                                                            if ('function' == typeof obj[key]) {
                                                              var fn = obj[key];
                                                      Severity: Minor
                                                      Found in libs/mocha.js - About 1 hr to fix

                                                        Function JSONReporter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        function JSONReporter(runner) {
                                                          var self = this;
                                                          Base.call(this, runner);
                                                        
                                                          var tests = []
                                                        Severity: Minor
                                                        Found in libs/mocha.js - About 1 hr to fix

                                                          Function hook has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                          Runner.prototype.hook = function(name, fn){
                                                            var suite = this.suite
                                                              , hooks = suite['_' + name]
                                                              , self = this
                                                              , timer;
                                                          Severity: Minor
                                                          Found in libs/mocha.js - About 1 hr to fix

                                                            Function parse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                            function parse(str) {
                                                              var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
                                                              if (!match) return;
                                                              var n = parseFloat(match[1]);
                                                              var type = (match[2] || 'ms').toLowerCase();
                                                            Severity: Minor
                                                            Found in libs/mocha.js - About 1 hr to fix

                                                              Function Dot has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                              function Dot(runner) {
                                                                Base.call(this, runner);
                                                              
                                                                var self = this
                                                                  , stats = this.stats
                                                              Severity: Minor
                                                              Found in libs/mocha.js - About 1 hr to fix

                                                                Function List has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                function List(runner) {
                                                                  Base.call(this, runner);
                                                                
                                                                  var self = this
                                                                    , stats = this.stats
                                                                Severity: Minor
                                                                Found in libs/mocha.js - About 1 hr to fix

                                                                  Function draw has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                  Progress.prototype.draw = function(ctx){
                                                                    try {
                                                                      var percent = Math.min(this.percent, 100)
                                                                        , size = this._size
                                                                        , half = size / 2
                                                                  Severity: Minor
                                                                  Found in libs/mocha.js - About 1 hr to fix

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

                                                                    function coverage(filename, data) {
                                                                      var ret = {
                                                                        filename: filename,
                                                                        coverage: 0,
                                                                        hits: 0,
                                                                    Severity: Minor
                                                                    Found in libs/mocha.js - About 1 hr to fix

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

                                                                      function Mocha(options) {
                                                                        options = options || {};
                                                                        this.files = [];
                                                                        this.options = options;
                                                                        this.grep(options.grep);
                                                                      Severity: Minor
                                                                      Found in libs/mocha.js - About 1 hr to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                      if (lines.length <= 4) {
                                                                                        eofNL(ret, i, current);
                                                                                      }
                                                                        Severity: Major
                                                                        Found in libs/mocha.js - About 45 mins to fix

                                                                          Function createPatch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
                                                                          Severity: Minor
                                                                          Found in libs/mocha.js - About 35 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                          return basePath.components;
                                                                            Severity: Major
                                                                            Found in libs/mocha.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                  if (!match) return next();
                                                                              Severity: Major
                                                                              Found in libs/mocha.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                  return emptyRepresentation(value, type);
                                                                                Severity: Major
                                                                                Found in libs/mocha.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                      else return indent + line;
                                                                                  Severity: Major
                                                                                  Found in libs/mocha.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                      return ms + 'ms';
                                                                                    Severity: Major
                                                                                    Found in libs/mocha.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                            return next();
                                                                                      Severity: Major
                                                                                      Found in libs/mocha.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                            return matched.length == 0 && (!global.navigator || 'onerror' !== key);
                                                                                        Severity: Major
                                                                                        Found in libs/mocha.js - About 30 mins to fix

                                                                                          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

                                                                                          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.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.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 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

                                                                                          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

                                                                                          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

                                                                                          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 1397..1401

                                                                                          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

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

                                                                                              context.describe.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 1361..1367

                                                                                          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

                                                                                          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

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

                                                                                              context.describe = context.context = function(title, fn){
                                                                                                var suite = Suite.create(suites[0], title);
                                                                                                suite.file = file;
                                                                                                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 1349..1356

                                                                                          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 82.

                                                                                          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

                                                                                              context.suite = function(title, fn){
                                                                                                var suite = Suite.create(suites[0], title);
                                                                                                suite.file = file;
                                                                                                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 997..1004

                                                                                          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 82.

                                                                                          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

                                                                                              context.test = function(title, fn){
                                                                                                var suite = suites[0];
                                                                                                if (suite.pending) fn = null;
                                                                                                var test = new Test(title, fn);
                                                                                                test.file = file;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                                                                                          libs/mocha.js on lines 1036..1043

                                                                                          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 79.

                                                                                          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

                                                                                              context.it = context.specify = function(title, fn){
                                                                                                var suite = suites[0];
                                                                                                if (suite.pending) fn = null;
                                                                                                var test = new Test(title, fn);
                                                                                                test.file = file;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 2 hrs to fix
                                                                                          libs/mocha.js on lines 1384..1391

                                                                                          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 79.

                                                                                          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.enableTimeouts = function(enabled){
                                                                                            if (arguments.length === 0) return this._enableTimeouts;
                                                                                            debug('enableTimeouts %s', enabled);
                                                                                            this._enableTimeouts = enabled;
                                                                                            return this;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 4345..4350

                                                                                          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 66.

                                                                                          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

                                                                                          Runnable.prototype.enableTimeouts = function(enabled){
                                                                                            if (arguments.length === 0) return this._enableTimeouts;
                                                                                            debug('enableTimeouts %s', enabled);
                                                                                            this._enableTimeouts = enabled;
                                                                                            return this;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 5316..5321

                                                                                          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 66.

                                                                                          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

                                                                                            runner.on('pending', function(test){
                                                                                              if (++n % width == 0) process.stdout.write('\n  ');
                                                                                              process.stdout.write(color('pending', Base.symbols.dot));
                                                                                            });
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 2525..2528

                                                                                          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 61.

                                                                                          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

                                                                                            runner.on('fail', function(test, err){
                                                                                              if (++n % width == 0) process.stdout.write('\n  ');
                                                                                              process.stdout.write(color('fail', Base.symbols.dot));
                                                                                            });
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 2511..2514

                                                                                          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 61.

                                                                                          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.suite.only = function(title, fn){
                                                                                                var suite = context.suite(title, fn);
                                                                                                mocha.grep(suite.fullTitle());
                                                                                              };
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 1231..1234

                                                                                          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 60.

                                                                                          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.suite.only = function(title, fn){
                                                                                                var suite = context.suite(title, fn);
                                                                                                mocha.grep(suite.fullTitle());
                                                                                              };
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 1 other location - About 1 hr to fix
                                                                                          libs/mocha.js on lines 1373..1376

                                                                                          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 60.

                                                                                          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

                                                                                          var Date = global.Date
                                                                                            , setTimeout = global.setTimeout
                                                                                            , setInterval = global.setInterval
                                                                                            , clearTimeout = global.clearTimeout
                                                                                            , clearInterval = global.clearInterval;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 3 other locations - About 50 mins to fix
                                                                                          libs/mocha.js on lines 1965..1969
                                                                                          libs/mocha.js on lines 2616..2620
                                                                                          libs/mocha.js on lines 4098..4102

                                                                                          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 51.

                                                                                          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

                                                                                          var Date = global.Date
                                                                                            , setTimeout = global.setTimeout
                                                                                            , setInterval = global.setInterval
                                                                                            , clearTimeout = global.clearTimeout
                                                                                            , clearInterval = global.clearInterval;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 3 other locations - About 50 mins to fix
                                                                                          libs/mocha.js on lines 1965..1969
                                                                                          libs/mocha.js on lines 2616..2620
                                                                                          libs/mocha.js on lines 4255..4259

                                                                                          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 51.

                                                                                          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

                                                                                          var Date = global.Date
                                                                                            , setTimeout = global.setTimeout
                                                                                            , setInterval = global.setInterval
                                                                                            , clearTimeout = global.clearTimeout
                                                                                            , clearInterval = global.clearInterval;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 3 other locations - About 50 mins to fix
                                                                                          libs/mocha.js on lines 2616..2620
                                                                                          libs/mocha.js on lines 4098..4102
                                                                                          libs/mocha.js on lines 4255..4259

                                                                                          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 51.

                                                                                          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

                                                                                          var Date = global.Date
                                                                                            , setTimeout = global.setTimeout
                                                                                            , setInterval = global.setInterval
                                                                                            , clearTimeout = global.clearTimeout
                                                                                            , clearInterval = global.clearInterval;
                                                                                          Severity: Major
                                                                                          Found in libs/mocha.js and 3 other locations - About 50 mins to fix
                                                                                          libs/mocha.js on lines 1965..1969
                                                                                          libs/mocha.js on lines 4098..4102
                                                                                          libs/mocha.js on lines 4255..4259

                                                                                          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 51.

                                                                                          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

                                                                                            runner.on('end', function(){
                                                                                              cursor.show();
                                                                                              console.log();
                                                                                              self.epilogue();
                                                                                            });
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 35 mins to fix
                                                                                          libs/mocha.js on lines 3311..3315

                                                                                          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 46.

                                                                                          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

                                                                                          Context.prototype.enableTimeouts = function (enabled) {
                                                                                            this.runnable().enableTimeouts(enabled);
                                                                                            return this;
                                                                                          };
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 35 mins to fix
                                                                                          libs/mocha.js on lines 849..852

                                                                                          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 46.

                                                                                          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

                                                                                          Context.prototype.slow = function(ms){
                                                                                            this.runnable().slow(ms);
                                                                                            return this;
                                                                                          };
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 35 mins to fix
                                                                                          libs/mocha.js on lines 835..838

                                                                                          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 46.

                                                                                          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

                                                                                            runner.on('end', function(){
                                                                                              cursor.show();
                                                                                              console.log();
                                                                                              self.epilogue();
                                                                                            });
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 35 mins to fix
                                                                                          libs/mocha.js on lines 3899..3903

                                                                                          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 46.

                                                                                          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

                                                                                          function clean(test) {
                                                                                            return {
                                                                                                title: test.title
                                                                                              , fullTitle: test.fullTitle()
                                                                                              , duration: test.duration
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 30 mins to fix
                                                                                          libs/mocha.js on lines 3120..3126

                                                                                          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 45.

                                                                                          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

                                                                                                  if (change.added) {
                                                                                                    ret.push('</ins>');
                                                                                                  } else if (change.removed) {
                                                                                                    ret.push('</del>');
                                                                                                  }
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 30 mins to fix
                                                                                          libs/mocha.js on lines 396..400

                                                                                          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 45.

                                                                                          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

                                                                                                  if (change.added) {
                                                                                                    ret.push('<ins>');
                                                                                                  } else if (change.removed) {
                                                                                                    ret.push('<del>');
                                                                                                  }
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 30 mins to fix
                                                                                          libs/mocha.js on lines 404..408

                                                                                          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 45.

                                                                                          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

                                                                                          function clean(test) {
                                                                                            return {
                                                                                                title: test.title
                                                                                              , fullTitle: test.fullTitle()
                                                                                              , duration: test.duration
                                                                                          Severity: Minor
                                                                                          Found in libs/mocha.js and 1 other location - About 30 mins to fix
                                                                                          libs/mocha.js on lines 3054..3060

                                                                                          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 45.

                                                                                          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

                                                                                          There are no issues that match your filters.

                                                                                          Category
                                                                                          Status