Showing 44 of 112 total issues
Function handler
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.handler = function (config) {
console.log('config::', config)
const _ = require('lodash');
const path = require('path');
const fs = require('fs');
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
const router = express.Router();
let server;
router.get('/doctor', async function(req, res) {
Function generateMatrix
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function generateMatrix(filePath: string): Promise<MatrixEntries> {
let finalResult: any = [];
const reflowContext = createReflowContext()
await runInSandbox(filePath, reflowContext)
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function(config) {
console.log('Binding models.');
const bindModels = util.promisify(models.setDirectory( __dirname + '/models').bind);
try {
Function runFlows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
runFlows() {
const flowsList = Object.values(this.flows);
console.log(`${flowsList.length} total flows.`)
let totalCombinations = 0;
const matrices = flowsList.map(({name, fn}) => {
Function createReflowContext
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createReflowContext = () => {
const matrix:MatrixEntries = [];
const reflowContext = {
matrix,
flow(title: Title, flowDetails: any) {
Function _execute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function _execute (elementId, methodName, args = [], skipScreenshotAndSource = false) {
let cachedEl;
let res = {};
if (elementId) {
Function sendRequest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendRequest(type, data) {
process.stdout.write(`\nSending request (${type}) to: ${hostname}:${port}${path}`);
const postData = JSON.stringify(data);
const contentLength = Buffer.byteLength(postData);
const reqOptions = {
Function _execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async function _execute (elementId, methodName, args = [], skipScreenshotAndSource = false) {
let cachedEl;
let res = {};
if (elementId) {
- 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 render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { match, data } = this.props;
const projectName = match.params.projectName;
const selectedJobID = match.params.jobID;
Function createReflowContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const createReflowContext = function(filepath) {
const self = this;
return {
describe(name) {
self.suites[name] = filepath
- 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 evaluateFlow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const evaluateFlow = function(suites, activeTags) {
const formattedSuites = suites
.filter(Boolean)
.map(branch => _.isArray(branch)? branch : [branch])
.filter(branch => _.isMatch(branch[0].tags, activeTags))
- 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 createReflowContext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const createReflowContext = function(filepath) {
const self = this;
return {
describe(name) {
self.suites[name] = filepath
- 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 evaluateFlow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const evaluateFlow = function(suites, activeTags) {
const formattedSuites = suites
.filter(Boolean)
.map(branch => Array.isArray(branch)? branch : [branch])
.filter(branch => isMatch(branch[0].tags, activeTags))
- 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 installSelenium
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const installSelenium = function(opts={}) {
let lastPercentage;
return installSeleniumAsync({
// check for more recent versions of selenium here:
// https://selenium-release.storage.googleapis.com/index.html
Function getFlow
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getFlow = function(): Flow {
const flowObjects: FlowObject = {};
return {
get(name: string, fallback: any): void {
const flowObject = flowObjects[name];
Function parseDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const parseDir = function parseDir(callerFilename, opts) {
opts = opts || {}
// disable recursion to support nested directories of subcommands
if (typeof opts.recurse !== 'boolean') opts.recurse = true
// exclude 'json', 'coffee' from require-directory defaults
- 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 parseDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const parseDir = function parseDir(callerFilename, opts) {
opts = opts || {}
// disable recursion to support nested directories of subcommands
if (typeof opts.recurse !== 'boolean') opts.recurse = true
// exclude 'json', 'coffee' from require-directory defaults
- 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 parseDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const parseDir = function parseDir(dir, callerFilename, opts) {
opts = opts || {}
// disable recursion to support nested directories of subcommands
if (typeof opts.recurse !== 'boolean') opts.recurse = true
// exclude 'json', 'coffee' from require-directory defaults
- 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 ReflowReporter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ReflowReporter = function(runner, options = {}) {
const reporterOptions = options.reporterOptions || {};
const {
combinationID,
flowDetails,
- 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"