Showing 30 of 38 total issues
File index.js
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-continue */
/* eslint-disable class-methods-use-this */
/* eslint-disable no-underscore-dangle */
'use strict';
- Create a ticketCreate a ticket
Function buildHelpOutput
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
buildHelpOutput(commandName) {
const sections = [];
const commands = [...this.commands.values()].filter(
(x) => x.commandName !== '$$root',
);
- Read upRead up
- Create a ticketCreate a ticket
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 lintFiles
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
async function* lintFiles(patterns, options) {
const opts = { dirs: [], cwd: process.cwd(), ...options };
opts.exclude = opts.exclude || DEFAULT_IGNORE;
opts.extensions = opts.extensions || DEFAULT_EXTENSIONS;
opts.cacheLocation =
- Read upRead up
- Create a ticketCreate a ticket
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
Yaro
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Yaro {
constructor(programName, options) {
if (isObject(programName) && !options) {
options = programName; // eslint-disable-line no-param-reassign
programName = null; // eslint-disable-line no-param-reassign
- Create a ticketCreate a ticket
Function wrapper
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrapper(prog) {
return prog
.option('--init', 'Create lint config from fully resolved ESLint config')
.option('--fix', 'Automatically fix problems')
.option('--warnings', 'Shows warnings too', false)
- Create a ticketCreate a ticket
Function buildHelpOutput
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildHelpOutput(commandName) {
const sections = [];
const commands = [...this.commands.values()].filter(
(x) => x.commandName !== '$$root',
);
- Create a ticketCreate a ticket
Function createJestCommand
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.createJestCommand = function createJestCommand(prog) {
return (name, description, settings = {}) =>
(prog || hela())
.command(name, description)
.alias(settings.alias)
- Create a ticketCreate a ticket
Function lintFiles
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function* lintFiles(patterns, options) {
const opts = { dirs: [], cwd: process.cwd(), ...options };
opts.exclude = opts.exclude || DEFAULT_IGNORE;
opts.extensions = opts.extensions || DEFAULT_EXTENSIONS;
opts.cacheLocation =
- Create a ticketCreate a ticket
File api.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */
/* eslint-disable no-restricted-syntax */
/* eslint-disable max-statements */
- Create a ticketCreate a ticket
Function __getResult
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
__getResult(argv) {
const flagAliases = {};
[...this.commands.entries()].forEach(([_, cmd]) => {
[...cmd.flags.entries()].forEach(([flagName, flag]) => {
- Create a ticketCreate a ticket
Function parse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse(argv = processArgv, options = {}) {
// NOTE: it's in a single command mode but does not have `.action` defined,
// so we create noop one o uccessfully continue
if (!this.currentCommand && this.settings.singleMode === true) {
this.action(() => {});
- Create a ticketCreate a ticket
Function createJestRollupConfig
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function createJestRollupConfig(options) {
const opts = { cwd: process.cwd(), ...options };
const { exts, alias, workspaces } = utils.createAliases(opts.cwd);
const ignores = []
.concat(opts.ignores)
- Create a ticketCreate a ticket
Function ssss
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
.action(async function ssss(argv) {
// switch the env set by default when running Jest. For ensurance.
process.env.NODE_ENV = name;
// console.log(arguments);
- Create a ticketCreate a ticket
Function tryLoadConfig
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function tryLoadConfig(name) {
let mod = null;
try {
mod = require(name);
- Read upRead up
- Create a ticketCreate a ticket
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 createJestESLintConfig
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function createJestESLintConfig(options) {
const opts = { cwd: process.cwd(), ...options };
const { exts, alias, workspaces } = utils.createAliases(opts.cwd);
const ignores = []
.concat(opts.ignores)
- Create a ticketCreate a ticket
Function createJestBabelConfig
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function createJestBabelConfig(options) {
const opts = { cwd: process.cwd(), ...options };
const { exts, alias, workspaces } = utils.createAliases(opts.cwd);
const ignores = []
.concat(opts.ignores)
- Create a ticketCreate a ticket
Function injectIntoLinter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function injectIntoLinter(config, linter) {
if (!config) {
return linter;
}
- Create a ticketCreate a ticket
Function createFlag
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
createFlag(rawName, description, config) {
const flag = {
rawName,
description,
};
- Create a ticketCreate a ticket
Function checkHelp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
checkHelp(cmd) {
if (this.result.flags.help) {
const name = cmd && cmd.command && cmd.command.commandName;
this.showHelp(this.settings.defaultCommand ? '' : name);
- Read upRead up
- Create a ticketCreate a ticket
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 createJestCommand
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.createJestCommand = function createJestCommand(prog) {
return (name, description, settings = {}) =>
(prog || hela())
.command(name, description)
.alias(settings.alias)
- Read upRead up
- Create a ticketCreate a ticket
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"