TheBrainFamily/chimpy

View on GitHub

Showing 52 of 131 total issues

Function killSession has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var killSession = function (job) {
    // This will stop the session, causing a 'User terminated' error.
    // If we don't manually stop the session, we get a timed-out error.
    var options = {
      url: this.options.sauceLabsUrl + '/jobs/' + job.id + '/stop',
Severity: Minor
Found in src/lib/saucelabs-manager.js - About 1 hr to fix

    Function kill has a Cognitive Complexity of 10 (exceeds 5 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

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

      setupGlobals: function () {
        global.wrapAsync = wrapAsync;
        global.wrapAsyncObject = wrapAsyncObject;
    
        // give users access the request module
    Severity: Minor
    Found in src/lib/chimp-helper.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 runJasmineInFiber has a Cognitive Complexity of 10 (exceeds 5 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

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

    Chimp.prototype.interrupt = function (callback) {
      log.debug('[chimp] interrupting');
    
      const self = this;
    
    
    Severity: Minor
    Found in src/lib/chimp.js - About 1 hr to fix

      Function addServerExecute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var addServerExecute = function (ddpInstance) {
            ddpInstance.execute = function (func) {
              var args = Array.prototype.slice.call(arguments, 1);
              var result;
              var timeout = parseInt(process.env['chimp.serverExecuteTimeout']) || 10000;
      Severity: Minor
      Found in src/lib/chimp-helper.js - About 1 hr to fix

        Function Chimp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function Chimp(options) {
          this.chokidar = chokidar;
          this.options = options || {};
          this.processes = [];
          this.isInterrupting = false;
        Severity: Minor
        Found in src/lib/chimp.js - About 45 mins 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 8 (exceeds 5 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: Minor
        Found in src/lib/browserstack-manager.js - About 45 mins 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 a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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 getJasmineConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        function getJasmineConfig() {
          const jasmineConfig = JSON.parse(process.env['chimp.jasmineConfig']);
        
          if (jasmineConfig.specDir) {
            if (!jasmineConfig.spec_dir) {
        Severity: Minor
        Found in src/lib/jasmine/jasmine-wrapper.js - About 35 mins 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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        Chimp.prototype.init = function (callback) {
          const self = this;
        
          this.informUser();
        
        
        Severity: Minor
        Found in src/lib/chimp.js - About 35 mins 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 getOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          getOptions() {
            let userOptionsFile;
            const processArgv = this._getProcessArgv();
            if (processArgv[2] && processArgv[2].match(/.*chimp.*\.js$/)) {
              userOptionsFile = path.resolve(process.cwd(), processArgv[2]);
        Severity: Minor
        Found in src/lib/options-loader.js - About 25 mins 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