TheBrainFamily/chimpy

View on GitHub

Showing 52 of 131 total issues

File chimp-spec.js has 642 lines of code (exceeds 250 allowed). Consider refactoring.
Open

jest.dontMock('../lib/chimp.js');
jest.dontMock('../lib/boolean-helper');
jest.dontMock('underscore');
jest.dontMock('async');
jest.dontMock('wrappy');
Severity: Major
Found in src/__tests__/chimp-spec.js - About 1 day to fix

    Function setupBrowserAndDDP has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

      setupBrowserAndDDP: function () {
    
        var setupBrowser = function () {
          log.debug('[chimp][helper] getting browser');
    
    
    Severity: Minor
    Found in src/lib/chimp-helper.js - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    File chimp.js has 501 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Externals
     */
    let async = require('async'),
      path = require('path'),
    Severity: Major
    Found in src/lib/chimp.js - About 1 day to fix

      Function setupBrowserAndDDP has 178 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        setupBrowserAndDDP: function () {
      
          var setupBrowser = function () {
            log.debug('[chimp][helper] getting browser');
      
      
      Severity: Major
      Found in src/lib/chimp-helper.js - About 7 hrs to fix

        Function Versions has 175 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Versions(options) {
          this.options = options;
        
          this.appDir = '../..';
          this.chromeDriverExec = chromedriver.path;
        Severity: Major
        Found in src/lib/versions.js - About 7 hrs to fix

          Function _createProcesses has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

          Chimp.prototype._createProcesses = function () {
            const processes = [];
            const self = this;
          
            const addTestRunnerToRunOrder = function (name, type) {
          Severity: Minor
          Found in src/lib/chimp.js - About 5 hrs 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 Versions has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

          function Versions(options) {
            this.options = options;
          
            this.appDir = '../..';
            this.chromeDriverExec = chromedriver.path;
          Severity: Minor
          Found in src/lib/versions.js - About 3 hrs 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 hooks has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function hooks() {
            const screenshots = {};
          
            this.setDefaultTimeout(60 * 1000);
          
          
          Severity: Major
          Found in src/lib/cucumberjs/hooks.js - About 3 hrs to fix

            Function start has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

              Mocha.prototype.start = function (callback) {
              
                var self = this;
                if (glob.sync(self.options.path).length === 0) {
                  const infoMessage = `[chimp][mocha] Directory ${self.options.path} does not exist. Not running`;
              Severity: Minor
              Found in src/lib/mocha/mocha.js - About 3 hrs 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 _createProcesses has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Chimp.prototype._createProcesses = function () {
                const processes = [];
                const self = this;
              
                const addTestRunnerToRunOrder = function (name, type) {
              Severity: Major
              Found in src/lib/chimp.js - About 3 hrs to fix

                File selenium-spec.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint-disable global-require */
                jest.dontMock('../lib/selenium');
                jest.dontMock('../lib/boolean-helper');
                jest.dontMock('underscore');
                
                
                Severity: Minor
                Found in src/__tests__/selenium-spec.js - About 2 hrs to fix

                  Function Cli has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Cli(argv) {
                    var Cucumber = require('cucumber');
                    var Command = require('commander').Command;
                    var path = require('path');
                  
                  
                  Severity: Major
                  Found in src/lib/cucumberjs/cucumber-wrapper.js - About 2 hrs to fix

                    Function start has 59 lines of code (exceeds 25 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: Major
                    Found in src/lib/jasmine/jasmine.js - About 2 hrs to fix

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

                      SauceLabsSessionManager.prototype.killCurrentSession = function (callback) {
                      
                        var self = this;
                        var killSession = function (job) {
                          // This will stop the session, causing a 'User terminated' error.
                      Severity: Major
                      Found in src/lib/saucelabs-manager.js - About 2 hrs to fix

                        Function _monkeyPatchBrowserSessionManagement has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function watch has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          AutoupdateWatcher.prototype.watch = function (trigger) {
                            var self = this;
                            self._trigger = trigger;
                            self._ddpClient = new DDPClient({
                              // All properties optional, defaults shown
                          Severity: Major
                          Found in src/lib/ddp-watcher.js - About 2 hrs to fix

                            Function getCurrentBrowserVersion has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              this.getCurrentBrowserVersion = (callback) => {
                                if (booleanHelper.isTruthy(this.options.browser)) {
                                  const seleniumOptions = _.clone(this.options.seleniumStandaloneOptions);
                                  seleniumOptions.port = 1;
                            
                            
                            Severity: Major
                            Found in src/lib/versions.js - About 2 hrs to fix

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

                              BrowserStackSessionManager.prototype.killCurrentSession = function (callback) {
                              
                                var self = this;
                                var wdOptions = this.options;
                                const wdHubSession = 'http://' + wdOptions.host + ':' + wdOptions.port + '/wd/hub/session';
                              Severity: Major
                              Found in src/lib/browserstack-manager.js - About 2 hrs to fix

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

                                    var setupBrowser = function () {
                                      log.debug('[chimp][helper] getting browser');
                                
                                      const webdriverioConfigOptions = JSON.parse(process.env['chimp.webdriverio']);
                                      const webdriverioOptions = merge(
                                Severity: Minor
                                Found in src/lib/chimp-helper.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language