Showing 118 of 571 total issues
Function processRocObject
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
export default function processRocObject(
{ roc, newContext = {} },
state,
allowNewDependencies = true,
allowUpdateDependencies = true,
- 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 createResolveRequest
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
export default function createResolveRequest(exports, directory, dependencyContext) {
const log = require('debug')('roc:core:require'); // eslint-disable-line
const contextCache = {};
// Matches a module request, getting the module and a possible scope
- 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 createResolveRequest
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createResolveRequest(exports, directory, dependencyContext) {
const log = require('debug')('roc:core:require'); // eslint-disable-line
const contextCache = {};
// Matches a module request, getting the module and a possible scope
Function initContext
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export default function initContext({
verbose = false,
commands: baseCommands = {},
directory = process.cwd(),
projectConfigPath,
- 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 getExtensions.js
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { _findPath } from 'module';
import { join, dirname, isAbsolute } from 'path';
import resolve from 'resolve';
import { bold, underline } from 'chalk';
Function buildCommand
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildCommand(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
let rows = [];
rows.push(`##${'#'.repeat(level)} ${command}`);
Function hooksToMarkdown
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function hooksToMarkdown(name, hooks = {}, mode) {
const rows = [];
rows.push(`# Hooks for \`${name}\``, '');
Function generateCommandDocumentation
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export default function generateCommandDocumentation(settings, metaSettings, metaCommands, command, name, parents) {
const rows = [];
rows.push(`Usage: ${name} ${parents.concat(command).join(' ')}` +
getCommandArgumentsAsString(metaCommands[command]));
rows.push('');
- 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 buildCommand
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function buildCommand(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
let rows = [];
rows.push(`##${'#'.repeat(level)} ${command}`);
- 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 generateCommandDocumentation
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function generateCommandDocumentation(settings, metaSettings, metaCommands, command, name, parents) {
const rows = [];
rows.push(`Usage: ${name} ${parents.concat(command).join(' ')}` +
getCommandArgumentsAsString(metaCommands[command]));
rows.push('');
Function runCli
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export default function runCli({
info = { version: 'Unknown', name: 'Unknown' },
commands: initialCommands,
argv = process.argv,
invoke = true,
- 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 buildDocumentationObject
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function buildDocumentationObject(
initalObject,
initalMeta = {},
initalFilter = [],
markdown = false,
Function parseCommandOptions
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseCommandOptions(command, notManaged) {
let possibleCommandOptions = [];
let possibleCommandOptionsShort = [];
const parsedOptions = {
managed: {},
Consider simplifying this complex logical expression. Open
if (
!isAbstract(roc.name) &&
!roc.packages &&
!roc.plugins &&
!roc.hooks &&
Function generateTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function generateTable(initalDocumentationObject, header, settings) {
const finalSettings = merge(defaultSettings, settings);
const headerLengths = createLengthObject(header, header, {}, true);
const lengths = createLengthObject(initalDocumentationObject, header, headerLengths);
- 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 generateTable
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function generateTable(initalDocumentationObject, header, settings) {
const finalSettings = merge(defaultSettings, settings);
const headerLengths = createLengthObject(header, header, {}, true);
const lengths = createLengthObject(initalDocumentationObject, header, headerLengths);
Function initAction
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initAction = (currentAction) => (post = false) => {
// Run actions in a semi-managed way
let step = 'first';
try {
const createAction = currentAction({
Function dependenciesToMarkdown
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function dependenciesToMarkdown(name, extension, dependencies = {}) {
const rows = [];
rows.push(`# Dependencies for \`${name}\``, '');
File commandsToMarkdown.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
import redent from 'redent';
import stripAnsi from 'strip-ansi';
import trimNewlines from 'trim-newlines';
import generateTable from '../generateTable';
Function getDefaultCommands
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDefaultCommands(directory) {
if (directory === undefined || validRocProject(directory)) {
return {
meta: {
__meta: {