TheBrainFamily/chimpy

View on GitHub

Showing 131 of 131 total issues

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

    var setupDdp = function () {
      log.debug('[chimp][helper] setup DDP');
      if (process.env['chimp.ddp0']) {
        try {
          log.debug('[chimp][helper] connecting via DDP to', process.env['chimp.ddp0']);
Severity: Minor
Found in src/lib/chimp-helper.js - About 1 hr to fix

    Function _monkeyPatchBrowserSessionManagement has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    SessionManager.prototype._monkeyPatchBrowserSessionManagement = function (browser, sessions) {
    
      log.debug('[chimp][session-manager]', 'monkey patching the browser object');
    
      var callbacker = function () {
    Severity: Minor
    Found in src/lib/session-manager.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    Jasmine.prototype.start = function (callback) {
    
      var self = this;
      if (glob.sync(self.options.path).length === 0) {
        const infoMessage = `[chimp][jasmine] Directory ${self.options.path} does not exist. Not running`;
    Severity: Minor
    Found in src/lib/jasmine/jasmine.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 202..210
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

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

    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 7 locations. Consider refactoring.
    Open

          jest.doMock('chokidar', () => {
            return {
              watch: jest.fn(),
              watcher: {
                on: jest.fn(),
    Severity: Major
    Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/chimp-spec.js on lines 147..155
    src/__tests__/chimp-spec.js on lines 172..180
    src/__tests__/chimp-spec.js on lines 240..248
    src/__tests__/chimp-spec.js on lines 277..285
    src/__tests__/chimp-spec.js on lines 316..324
    src/__tests__/chimp-spec.js on lines 342..350

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

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

    SessionManager.prototype._configureRemote = function (webdriverOptions, remote, callback) {
      var self = this;
    
      log.debug('[chimp][session-manager] creating webdriver remote ');
    
    
    Severity: Minor
    Found in src/lib/session-manager.js - About 1 hr to fix

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

            jest.doMock('chokidar', () => {
              return {
                watch: jest.fn(),
                watcher: {
                  on: jest.fn(),
      Severity: Major
      Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
      src/__tests__/chimp-spec.js on lines 147..155
      src/__tests__/chimp-spec.js on lines 172..180
      src/__tests__/chimp-spec.js on lines 202..210
      src/__tests__/chimp-spec.js on lines 240..248
      src/__tests__/chimp-spec.js on lines 277..285
      src/__tests__/chimp-spec.js on lines 342..350

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

      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 7 locations. Consider refactoring.
      Open

            jest.doMock('chokidar', () => {
              return {
                watch: jest.fn(),
                watcher: {
                  on: jest.fn(),
      Severity: Major
      Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
      src/__tests__/chimp-spec.js on lines 147..155
      src/__tests__/chimp-spec.js on lines 172..180
      src/__tests__/chimp-spec.js on lines 202..210
      src/__tests__/chimp-spec.js on lines 240..248
      src/__tests__/chimp-spec.js on lines 316..324
      src/__tests__/chimp-spec.js on lines 342..350

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

      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

          it('sets the options on the instance when no exceptions are thrown', function () {
            var SessionManager = require('../lib/session-manager');
            var options = {port: 1234, browser: 'something'};
      
            var sessionManager = new SessionManager(options);
      Severity: Major
      Found in src/__tests__/session-manager-spec.js and 1 other location - About 1 hr to fix
      src/__tests__/session-factory-spec.js on lines 8..15

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

      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

          it('sets the options on the instance when no exceptions are thrown', function () {
            var SessionFactory = require('../lib/session-factory');
            var options = {port: 1234, browser: 'something'};
      
            var session = new SessionFactory(options);
      Severity: Major
      Found in src/__tests__/session-factory-spec.js and 1 other location - About 1 hr to fix
      src/__tests__/session-manager-spec.js on lines 12..19

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

      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 7 locations. Consider refactoring.
      Open

            jest.doMock('chokidar', () => {
              return {
                watch: jest.fn(),
                watcher: {
                  on: jest.fn(),
      Severity: Major
      Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
      src/__tests__/chimp-spec.js on lines 147..155
      src/__tests__/chimp-spec.js on lines 202..210
      src/__tests__/chimp-spec.js on lines 240..248
      src/__tests__/chimp-spec.js on lines 277..285
      src/__tests__/chimp-spec.js on lines 316..324
      src/__tests__/chimp-spec.js on lines 342..350

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

      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 7 locations. Consider refactoring.
      Open

            jest.doMock('chokidar', () => {
              return {
                watch: jest.fn(),
                watcher: {
                  on: jest.fn(),
      Severity: Major
      Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
      src/__tests__/chimp-spec.js on lines 147..155
      src/__tests__/chimp-spec.js on lines 172..180
      src/__tests__/chimp-spec.js on lines 202..210
      src/__tests__/chimp-spec.js on lines 277..285
      src/__tests__/chimp-spec.js on lines 316..324
      src/__tests__/chimp-spec.js on lines 342..350

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

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

      new Fiber(function runJasmineInFiber() {
        const projectDir = process.env.PWD;
        const testsDir = process.env['chimp.path'];
        process.chdir(testsDir);
      
      
      Severity: Minor
      Found in src/lib/jasmine/jasmine-wrapper.js - About 1 hr to fix

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

              jest.doMock('chokidar', () => {
                return {
                  watch: jest.fn(),
                  watcher: {
                    on: jest.fn(),
        Severity: Major
        Found in src/__tests__/chimp-spec.js and 6 other locations - About 1 hr to fix
        src/__tests__/chimp-spec.js on lines 147..155
        src/__tests__/chimp-spec.js on lines 172..180
        src/__tests__/chimp-spec.js on lines 202..210
        src/__tests__/chimp-spec.js on lines 240..248
        src/__tests__/chimp-spec.js on lines 277..285
        src/__tests__/chimp-spec.js on lines 316..324

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

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

        module.exports = function (wallaby) {
        
          var fs = require('fs');
          var path = require('path');
          var babel = require('babel-core');
        Severity: Minor
        Found in wallaby.js - About 1 hr to fix

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

            kill: function (options, callback) {
          
              log.debug('[chimp][' + options.prefix + ']', 'kill called on ' + options.prefix + ' process with pid', options.child.pid);
          
              options.signal = options.signal || 'SIGTERM';
          Severity: Minor
          Found in src/lib/process-helper.js - About 1 hr to fix

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

            TestingBotSessionManager.prototype.killCurrentSession = function (callback) {
            
              this._getJobs(function (err, jobs) {
                if (jobs && jobs.length) {
                  var job = jobs[0];
            Severity: Minor
            Found in src/lib/testingbot-manager.js - About 1 hr to fix

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

                if (booleanHelper.isTruthy(this.options.criticalSteps)) {
                  this.options.e2eSteps = this.options.criticalSteps;
                  log.warn('[chimp] Please use e2eSteps instead of criticalSteps. criticalSteps is now deprecated.'.red);
                }
              Severity: Major
              Found in src/lib/chimp.js and 1 other location - About 1 hr to fix
              src/lib/chimp.js on lines 134..137

              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

                if (booleanHelper.isTruthy(this.options.criticalTag)) {
                  this.options.e2eTags = this.options.criticalTag;
                  log.warn('[chimp] Please use e2eTags instead of criticalTag. criticalTag is now deprecated.'.red);
                }
              Severity: Major
              Found in src/lib/chimp.js and 1 other location - About 1 hr to fix
              src/lib/chimp.js on lines 129..132

              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 constructor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                constructor() {
                  let mochaConfig = JSON.parse(process.env.mochaConfig);
                  const mochaCommandLineOptions = process.env['chimp.mochaCommandLineOptions'] ? JSON.parse(process.env['chimp.mochaCommandLineOptions']) : false;
                  if (mochaCommandLineOptions && _.isObject(mochaCommandLineOptions)) {
                    _.extend(mochaConfig, mochaCommandLineOptions);
              Severity: Minor
              Found in src/lib/mocha/mocha-wrapper.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language