TheBrainFamily/chimpy

View on GitHub

Showing 52 of 131 total issues

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

Chimp.prototype.watch = function () {
  const self = this;

  let watchDirectories = [];
  if (self.options.watchSource) {
Severity: Minor
Found in src/lib/chimp.js - About 1 hr to fix

    Function run has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Chimp.prototype.run = function (callback) {
      log.info('\n[chimp] Running...'[DEFAULT_COLOR]);
    
      const self = this;
    
    
    Severity: Minor
    Found in src/lib/chimp.js - About 1 hr to fix

      Function _setupRoutes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Chimp.prototype._setupRoutes = function (server) {
        const self = this;
        server.route({
          method: 'GET',
          path: '/run',
      Severity: Minor
      Found in src/lib/chimp.js - About 1 hr to fix

        Function SessionManagerFactory has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function SessionManagerFactory(options) {
        
              log.debug('[chimp][session-manager-factory] options are', options);
        
              if (!options) {
        Severity: Minor
        Found in src/lib/session-factory.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 killCurrentSession has a Cognitive Complexity of 13 (exceeds 5 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: Minor
        Found in src/lib/saucelabs-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 constructor has 39 lines of code (exceeds 25 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

          Function report has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          SimianReporter.prototype.report = function report(jsonCucumberResult, callback) {
            SimianReporter.reportCallback = callback;
            const query = {
              accessToken: this.options.simianAccessToken,
            };
          Severity: Minor
          Found in src/lib/simian-reporter.js - About 1 hr to fix

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

            SessionManager.prototype.killCurrentSession = function (callback) {
            
            
              if (this.options.browser === 'phantomjs') {
                log.debug('[chimp][session-manager] browser is phantomjs, not killing session');
            Severity: Minor
            Found in src/lib/session-manager.js - About 1 hr to fix

              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

                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

                  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

                    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

                          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

                          Function _initSimianResultBranch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Chimp.prototype._initSimianResultBranch = function () {
                            // Automatically set the result branch for the common CI tools
                            if (this.options.simianAccessToken &&
                              this.options.simianResultBranch === null
                            ) {
                          Severity: Minor
                          Found in src/lib/chimp.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 initSingleBrowser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var initSingleBrowser = function (browser) {
                                log.debug('[chimp][helper] init browser');
                                log.debug('[chimp][helper] init browser callback');
                          
                                browser.screenshotsCount = 0;
                          Severity: Minor
                          Found in src/lib/chimp-helper.js - About 1 hr to fix

                            Function decideReuse has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function decideReuse() {
                            
                                if (self.options.browser === 'phantomjs') {
                                  log.debug('[chimp][session-manager] browser is phantomjs, not reusing a session');
                                  callback(null, browser);
                            Severity: Minor
                            Found in src/lib/session-manager.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language