broadsw0rd/enhanced-log

View on GitHub

Showing 86 of 86 total issues

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

        ,   bottomSpace = Array.apply(null, { length : padding.bottom }).map(function(){
                    return symbol + leftPadding + emptyRow + rightPadding + symbol
                }).join('\n\t')
Severity: Major
Found in src/log.js and 1 other location - About 1 hr to fix
src/log.js on lines 200..202

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

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

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

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

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

Refactorings

Further Reading

Function 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

          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

          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

            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

            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 _box has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _box(message, symbol, padding){
                                symbol = symbol || DEFAULT_BOX_SYMBOL
                        
                                if(typeof symbol == 'object'){
                                    padding = symbol
                        Severity: Minor
                        Found in src/log.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 _divider has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function _divider(text, symbol, length){
                                      length = length || DEFAULT_DIVIDER_LENGTH
                                      symbol = symbol || DEFAULT_DIVIDER_SYMBOL
                                      if(typeof text == 'number'){
                                          length = text
                              Severity: Minor
                              Found in src/log.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language