src/lib/chimp-helper.js
Function setupBrowserAndDDP
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
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
Function setupBrowserAndDDP
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupBrowserAndDDP: function () {
var setupBrowser = function () {
log.debug('[chimp][helper] getting browser');
Function setupBrowser
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setupBrowser = function () {
log.debug('[chimp][helper] getting browser');
const webdriverioConfigOptions = JSON.parse(process.env['chimp.webdriverio']);
const webdriverioOptions = merge(
Function setupDdp
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 initSingleBrowser
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var initSingleBrowser = function (browser) {
log.debug('[chimp][helper] init browser');
log.debug('[chimp][helper] init browser callback');
browser.screenshotsCount = 0;
Function setupGlobals
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
setupGlobals: function () {
global.wrapAsync = wrapAsync;
global.wrapAsyncObject = wrapAsyncObject;
// give users access the request module
- 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 addServerExecute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;