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) {
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;
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',
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) {
- 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 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.
- 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 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);
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,
};
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');
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']);
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 () {
- 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 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`;
- 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 _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 ');
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);
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';
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');
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];
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
) {
- 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 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);
- 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 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;
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);