silverbucket/jaribu

View on GitHub

Showing 66 of 66 total issues

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

      for (var j = 0, jlen = types.length; j < jlen; j++) {
        if (typeof t[types[j]].status === 'undefined') {
          summary.scaffolding.skipped =
                      summary.scaffolding.skipped + 1;
        } else if (!t[types[j]].status) {
Severity: Major
Found in lib/jaribu.js and 1 other location - About 1 day to fix
lib/jaribu.js on lines 612..625

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

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

    for (var i = 0, len = types.length; i < len; i++) {
      if (typeof suite[types[i]].status === 'undefined') {
        summary.scaffolding.skipped = summary.scaffolding.skipped + 1;
      } else if (!suite[types[i]].status) {
        summary.scaffolding.failed = summary.scaffolding.failed + 1;
Severity: Major
Found in lib/jaribu.js and 1 other location - About 1 day to fix
lib/jaribu.js on lines 577..591

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

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

File jaribu.js has 496 lines of code (exceeds 250 allowed). Consider refactoring.
Open

if (typeof define !== 'function') {
  var define = require('amdefine')(module);
}

define([ 'jaribu/colors', 'jaribu/display', 'jaribu/tools/Env',
Severity: Minor
Found in lib/jaribu.js - About 7 hrs to fix

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

          __browserWrite('<p>' + c.red + summary.tests.failed + c.reset + ' failed,  ' +
                c.green + summary.tests.passed + c.reset + ' passed, '+
                c.cyan + summary.tests.skipped + c.reset +' skipped, '+
                c.blue + summary.tests.total + c.reset + ' total.</p>');
    Severity: Major
    Found in lib/display.js and 1 other location - About 5 hrs to fix
    lib/display.js on lines 311..314

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

    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

          console.log(c.red + summary.tests.failed + c.reset + ' failed,  ' +
                c.green + summary.tests.passed + c.reset + ' passed, '+
                c.cyan + summary.tests.skipped + c.reset + ' skipped, '+
                c.blue + summary.tests.total + c.reset + ' total.');
    Severity: Major
    Found in lib/display.js and 1 other location - About 5 hrs to fix
    lib/display.js on lines 298..301

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

    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

          console.log(c.red + summary.scaffolding.failed + c.reset + ' failed,  ' +
                c.green + summary.scaffolding.passed + c.reset + ' passed, ' + 
                c.cyan + summary.scaffolding.skipped + c.reset + ' skipped, ' + 
                c.blue + summary.scaffolding.total + c.reset + ' total.');
    Severity: Major
    Found in lib/display.js and 1 other location - About 5 hrs to fix
    lib/display.js on lines 303..306

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

    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

          __browserWrite('<p>' + c.red + summary.scaffolding.failed + c.reset + ' failed,  ' +
                c.green + summary.scaffolding.passed + c.reset + ' passed, '+
                c.cyan + summary.scaffolding.skipped + c.reset + ' skipped, '+
                c.blue + summary.scaffolding.total + c.reset + ' total.</p>');
    Severity: Major
    Found in lib/display.js and 1 other location - About 5 hrs to fix
    lib/display.js on lines 316..319

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

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

        WebSocketClient.prototype.connect = function (onComplete) {
          var client = new WebSocket.client();
          var self = this;
    
          client.on('connectFailed', function (error) {
    Severity: Major
    Found in lib/tools/WebSocketClient.js - About 4 hrs to fix

      File display.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      if (typeof define !== 'function') {
        var define = require('amdefine')(module);
      }
      define(['jaribu/colors'], function (colors, undefined) {
       
      Severity: Minor
      Found in lib/display.js - About 4 hrs to fix

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

          pub.assertTypeHandler = function (obj, type, customMsg) {
            var status = false;
            var msg;
            if (this._assertType(obj, type, customMsg)) {
              status = true;
        Severity: Major
        Found in lib/tools/assertType.js and 1 other location - About 4 hrs to fix
        lib/tools/assertType.js on lines 49..61

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

        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

          pub.assertTypeFailHandler = function (obj, type, customMsg) {
            var status = false;
            var msg;
            if (this._assertType(obj, type, customMsg)) {
              status = false;
        Severity: Major
        Found in lib/tools/assertType.js and 1 other location - About 4 hrs to fix
        lib/tools/assertType.js on lines 36..48

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

        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

              for (i = 0; i < failedTestsLength; i += 1) {
                o = summary.tests.failObjs[i];
                pub.details('suite', o.obj.parent);
                pub.details(o.name, o.obj);
                pub.fail(o.type, o.obj);
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 381..387

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

        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

              for (i = 0; i < failedTestsLength; i += 1) {
                o = summary.tests.failObjs[i];
                pub.details('suite', o.obj.parent);
                pub.details(o.name, o.obj);
                pub.fail(o.type, o.obj);
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 350..356

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

        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

          _.takedown = {
            console: function (name) {
              if (name === 'suite') {
                process.stdout.write('#');
              } else {
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 166..181

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

        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

          _.setup = {
            console: function (name) {
              if (name === 'suite') {
                process.stdout.write('/');
              } else {
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 187..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 107.

        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

            browser: function (type, o) {
              var msg = '';
              if (o[type].failmsg) {
                msg = 'failed (' + o[type].failmsg + ')';
              } else {
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 205..213

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

        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

            console: function (type, o) {
              var msg = '';
              if (o[type].failmsg) {
                msg = 'failed (' + o[type].failmsg + ')';
              } else {
        Severity: Major
        Found in lib/display.js and 1 other location - About 3 hrs to fix
        lib/display.js on lines 214..222

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

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

          function isEqual(a, b) {
            if (b === undefined) { return false; }
            var p;
            if (Array.isArray(a)) {
              if (!Array.isArray(b)) {
        Severity: Major
        Found in lib/tools/assert.js - About 2 hrs to fix

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

            function fail(part, suiteIndex, testIndex, msg) {
              if (typeof testIndex === 'string') {
                msg = testIndex;
                testIndex = undefined;
              }
          Severity: Major
          Found in lib/jaribu.js - About 2 hrs to fix

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

                    if (o.obj.parent !== undefined) {
                      pub.details('suite', o.obj.parent);
                      pub.details(o.name, o.obj);
                    } else {
                      pub.details('suite', o.obj);
            Severity: Major
            Found in lib/display.js and 1 other location - About 2 hrs to fix
            lib/display.js on lines 367..372

            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

            Severity
            Category
            Status
            Source
            Language