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,
Severity: Minor
Found in src/context/extensions/helpers/processRocObject.js - About 7 hrs to fix

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
Severity: Minor
Found in src/require/createResolveRequest.js - About 6 hrs to fix

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
Severity: Major
Found in src/require/createResolveRequest.js - About 5 hrs to fix

    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,
    Severity: Minor
    Found in src/context/initContext.js - About 5 hrs to fix

    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';
    Severity: Minor
    Found in src/context/extensions/steps/getExtensions.js - About 4 hrs to fix

      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}`);
      
      
      Severity: Major
      Found in src/documentation/markdown/commandsToMarkdown.js - About 4 hrs to fix

        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}\``, '');
        
        
        Severity: Major
        Found in src/documentation/markdown/hooksToMarkdown.js - About 4 hrs to fix

          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('');
          Severity: Minor
          Found in src/cli/commands/documentation/generateCommandDocumentation.js - About 3 hrs to fix

          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}`);
          
          
          Severity: Minor
          Found in src/documentation/markdown/commandsToMarkdown.js - About 3 hrs to fix

          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('');
          Severity: Major
          Found in src/cli/commands/documentation/generateCommandDocumentation.js - About 3 hrs to fix

            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,
            Severity: Minor
            Found in src/cli/runCli.js - About 3 hrs to fix

            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,
            Severity: Major
            Found in src/documentation/buildDocumentationObject.js - About 2 hrs to fix

              Function parseCommandOptions has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function parseCommandOptions(command, notManaged) {
                  let possibleCommandOptions = [];
                  let possibleCommandOptionsShort = [];
                  const parsedOptions = {
                      managed: {},
              Severity: Major
              Found in src/cli/commands/parseOptions.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if (
                            !isAbstract(roc.name) &&
                            !roc.packages &&
                            !roc.plugins &&
                            !roc.hooks &&
                Severity: Critical
                Found in src/context/extensions/steps/getExtensions.js - About 2 hrs to fix

                  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);
                  
                  
                  Severity: Minor
                  Found in src/documentation/generateTable.js - About 2 hrs to fix

                  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);
                  
                  
                  Severity: Major
                  Found in src/documentation/generateTable.js - About 2 hrs to fix

                    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({
                    Severity: Major
                    Found in src/hooks/runHookDirectly.js - About 2 hrs to fix

                      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}\``, '');
                      
                      
                      Severity: Major
                      Found in src/documentation/markdown/dependenciesToMarkdown.js - About 2 hrs to fix

                        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';
                        Severity: Minor
                        Found in src/documentation/markdown/commandsToMarkdown.js - About 2 hrs to fix

                          Function getDefaultCommands has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getDefaultCommands(directory) {
                              if (directory === undefined || validRocProject(directory)) {
                                  return {
                                      meta: {
                                          __meta: {
                          Severity: Major
                          Found in src/context/helpers/getDefaults.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language