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');
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');
- Read upRead up
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'),
Function setupBrowserAndDDP
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupBrowserAndDDP: function () {
var setupBrowser = function () {
log.debug('[chimp][helper] getting browser');
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;
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) {
- Read upRead up
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;
- Read upRead up
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);
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`;
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`;
- Read upRead up
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) {
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');
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');
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`;
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.
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 () {
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
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;
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';
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(