TheBrainFamily/chimpy

View on GitHub

Showing 60 of 136 total issues

File chimp-spec.js has 582 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 513 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Function Versions has 194 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 47 (exceeds 5 allowed). Consider refactoring.
        Open

        Chimp.prototype._createProcesses = function () {
        
          var processes = [];
          const self = this;
        
        
        Severity: Minor
        Found in src/lib/chimp.js - About 7 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 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 a Cognitive Complexity of 33 (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 4 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 _createProcesses has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Chimp.prototype._createProcesses = function () {
              
                var processes = [];
                const self = this;
              
              
              Severity: Major
              Found in src/lib/chimp.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 start has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  start(callback) {
                    const args = this._getExecOptions(this.options);
                
                    if (!fs.existsSync(this.options.path)) {
                      const infoMessage = `[chimp][cucumber] Directory ${this.options.path} does not exist. Not running`;
                Severity: Major
                Found in src/lib/cucumberjs/cucumber.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 getCurrentBrowserVersion has 57 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

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

                          jest.dontMock('../lib/selenium');
                          jest.dontMock('../lib/boolean-helper');
                          jest.dontMock('underscore');
                          
                          describe('Selenium', function () {
                          Severity: Minor
                          Found in src/__tests__/selenium-spec.js - About 2 hrs to fix

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

                              _getExecOptions(options) {
                                const execOptions = ['node', path.resolve(__dirname,
                                  path.join('..', '..', '..', 'node_modules', '.bin', 'cucumber.js')
                                )];
                            
                            
                            Severity: Major
                            Found in src/lib/cucumberjs/cucumber.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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language