vgno/roc-config

View on GitHub

Showing 571 of 571 total issues

Function buildDocumentationObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    initalObject,
    initalMeta = {},
    initalFilter = [],
    markdown = false,
    initalLevel = 0
Severity: Minor
Found in src/documentation/buildDocumentationObject.js - About 35 mins to fix

    Function extractCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export default function extractCommand(commands = {}, potentialGroup, args, name, parents = []) {
    Severity: Minor
    Found in src/cli/commands/helpers/extractCommand.js - About 35 mins to fix

      Function validateMetaStructure has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function validateMetaStructure(name, intersections, stateConfigPaths, extensionMeta, stateMeta) {
      Severity: Minor
      Found in src/context/extensions/helpers/processConfig.js - About 35 mins to fix

        Function createDescription has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        function createDescription(param) {
            const infoObject = getInfoObject(param.validator);
            return `${(param.description && param.description + '  ') || ''}` +
                `${(infoObject.required && green('Required') + '  ') || ''}` +
                `${(param.default !== undefined && cyan(JSON.stringify(param.default)) + '  ') || ''}` +
        Severity: Minor
        Found in src/cli/commands/documentation/generateCommandDocumentation.js - About 35 mins 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 askQuestion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        async function askQuestion(data, key, prompt) {
            // Skip prompts whose when condition is not met, will bind the current context into the evaluation
            if (prompt.when && !evaluate(prompt.when, data)) {
                return;
            }
        Severity: Minor
        Found in src/commands/init/generateTemplate/ask.js - About 35 mins 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 verifyRequiredDependencies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function verifyRequiredDependencies(directory, required) {
            const mismatches = verifyInstalledDependencies(directory, required);
            if (mismatches.length > 0) {
                const header = {
                    name: {
        Severity: Minor
        Found in src/context/dependencies/verifyRequiredDependencies.js - About 35 mins 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if (Object.keys(dependencies).length === 0) {
                rows.push('__No dependencies available.__', '');
                return rows.join('\n');
            }
        Severity: Minor
        Found in src/documentation/markdown/dependenciesToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/hooksToMarkdown.js on lines 17..20

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    rows.push('__Connects to extension:__ ' +
                        (currentAction.extension ?
                            `\`${currentAction.extension}\`` :
                            'Not specified')
                        + '  '
        Severity: Minor
        Found in src/documentation/markdown/actionsToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/actionsToMarkdown.js on lines 67..72

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if (objects.length > 0) {
                    body = body.concat({
                        name: 'Command options',
                        level,
                        objects,
        Severity: Minor
        Found in src/documentation/markdown/commandsToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/commandsToMarkdown.js on lines 205..211

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    rows.push('__Connects to hook:__ ' +
                        (currentAction.hook ?
                            `\`${currentAction.hook}\`` :
                            'Not specified')
                        + '  '
        Severity: Minor
        Found in src/documentation/markdown/actionsToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/actionsToMarkdown.js on lines 59..64

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if (objects.length > 0) {
                    body = body.concat({
                        name: 'Arguments',
                        level,
                        objects,
        Severity: Minor
        Found in src/documentation/markdown/commandsToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/commandsToMarkdown.js on lines 228..234

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        if (objects.length > 0) {
                            body = body.concat({
                                name: 'Arguments',
                                level: 1,
                                objects,
        Severity: Minor
        Found in src/documentation/markdown/hooksToMarkdown.js and 1 other location - About 35 mins to fix
        src/cli/commands/documentation/generateCommandDocumentation.js on lines 62..68

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if (Object.keys(hooks).length === 0) {
                rows.push('__No hooks available.__', '');
                return rows.join('\n');
            }
        Severity: Minor
        Found in src/documentation/markdown/hooksToMarkdown.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/dependenciesToMarkdown.js on lines 6..9

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if (objects.length > 0) {
                    body = body.concat({
                        name: 'Command options',
                        level: 0,
                        objects,
        Severity: Minor
        Found in src/cli/commands/documentation/generateCommandDocumentation.js and 1 other location - About 35 mins to fix
        src/documentation/markdown/hooksToMarkdown.js on lines 89..95

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid too many return statements within this function.
        Open

                return toObject;
        Severity: Major
        Found in src/converters/automatic.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return {
                                  key: `.${key}${result.key}`,
                                  value: result.value,
                                  message: result.message,
                              };
          Severity: Major
          Found in src/validation/validators/isObject.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return true;
            Severity: Major
            Found in src/validation/validators/isArray.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return true;
              Severity: Major
              Found in src/validation/validators/isObject.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return commandResult;
                Severity: Major
                Found in src/cli/runCli.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return {
                              module,
                              rocContext: rocContext[module],
                          };
                  Severity: Major
                  Found in src/require/createResolveRequest.js - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language