vgno/roc-config

View on GitHub

Showing 571 of 571 total issues

Function verifyConfigurationStructure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function verifyConfigurationStructure(config, meta, projectConfig) {
    const getKeys = (obj, oldPath = '', allKeys = [], first = true) => {
        Object.keys(obj).forEach((key) => {
            const value = obj[key];
            const newPath = oldPath + key;
Severity: Minor
Found in src/context/helpers/verifyConfigurationStructure.js - About 1 hr to fix

    Function getExtension has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getExtension(extensionName, directory, type) {
        try {
            let path;
    
            if (extensionName.charAt(0) === '.' || isAbsolute(extensionName)) {
    Severity: Minor
    Found in src/context/extensions/steps/getExtensions.js - About 1 hr to fix

      Function makeGetterSpy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function makeGetterSpy(obj, getter) {
          let callCount = 0;
      
          // store reference to old getter for restore
          const oldGetter = obj.__lookupGetter__(getter);
      Severity: Minor
      Found in test/utils.js - About 1 hr to fix

        Function validateMetaStructure has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function validateMetaStructure(name, intersections, stateConfigPaths, extensionMeta, stateMeta) {
            intersections.forEach((intersect) => {
                const wasGroup = getGroup(stateConfigPaths, intersect);
        
                if (!wasGroup || get(extensionMeta, `${intersect}.__meta`)) {
        Severity: Minor
        Found in src/context/extensions/helpers/processConfig.js - About 1 hr to fix

          Function build has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function build(cli, commands, allSettingGroups, printGroup, hideCommands, statefulAnchor, parents = [], level = 0) {
          Severity: Major
          Found in src/documentation/markdown/commandsToMarkdown.js - About 1 hr to fix

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                            expect(newState).toEqual([{
                                project: false,
                                name: 'roc-package-a',
                                actions: [{
                                    action: () => {},
            Severity: Major
            Found in test/hooks/manageActions.js and 2 other locations - About 1 hr to fix
            test/hooks/manageActions.js on lines 115..125
            test/hooks/manageActions.js on lines 171..181

            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 55.

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                            originalState = [{
                                project: false,
                                name: 'roc-package-a',
                                actions: [{
                                    action: () => {},
            Severity: Major
            Found in test/hooks/manageActions.js and 2 other locations - About 1 hr to fix
            test/hooks/manageActions.js on lines 155..165
            test/hooks/manageActions.js on lines 171..181

            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 55.

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                            expect(newState).toEqual([{
                                project: false,
                                name: 'roc-package-a',
                                actions: [{
                                    action: () => {},
            Severity: Major
            Found in test/hooks/manageActions.js and 2 other locations - About 1 hr to fix
            test/hooks/manageActions.js on lines 115..125
            test/hooks/manageActions.js on lines 155..165

            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 55.

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                    canBeEmpty: {
                        name: 'Can be empty',
                        renderer: (input) => {
                            if (input === true) {
                                return 'Yes';
            Severity: Major
            Found in src/documentation/markdown/commandsToMarkdown.js and 2 other locations - About 55 mins to fix
            src/documentation/markdown/hooksToMarkdown.js on lines 119..130
            src/documentation/markdown/settingsToMarkdown.js on lines 42..53

            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 54.

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                            canBeEmpty: {
                                name: 'Can be empty',
                                renderer: (input) => {
                                    if (input === true) {
                                        return 'Yes';
            Severity: Major
            Found in src/documentation/markdown/hooksToMarkdown.js and 2 other locations - About 55 mins to fix
            src/documentation/markdown/commandsToMarkdown.js on lines 262..273
            src/documentation/markdown/settingsToMarkdown.js on lines 42..53

            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 54.

            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

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                    canBeEmpty: {
                        name: 'Can be empty',
                        renderer: (input) => {
                            if (input === true) {
                                return 'Yes';
            Severity: Major
            Found in src/documentation/markdown/settingsToMarkdown.js and 2 other locations - About 55 mins to fix
            src/documentation/markdown/commandsToMarkdown.js on lines 262..273
            src/documentation/markdown/hooksToMarkdown.js on lines 119..130

            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 54.

            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

                const plugins = usedExtensions.filter((extn) => extn.type === 'plugin' &&
                    // Do no list the plugin itself, this is based on the name of the extension and the current name of the
                    // project that this commands runs from.
                    extn.name !== commandObject.context.packageJSON.name);
            Severity: Minor
            Found in src/documentation/markdown/extensionsToMarkdown.js and 1 other location - About 55 mins to fix
            src/documentation/markdown/extensionsToMarkdown.js on lines 8..11

            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 54.

            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

                const packages = usedExtensions.filter((extn) => extn.type === 'package' &&
                    // Do no list the package itself, this is based on the name of the extension and the current name of the
                    // project that this commands runs from.
                    extn.name !== commandObject.context.packageJSON.name);
            Severity: Minor
            Found in src/documentation/markdown/extensionsToMarkdown.js and 1 other location - About 55 mins to fix
            src/documentation/markdown/extensionsToMarkdown.js on lines 13..16

            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 54.

            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

            Function init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            export default async function init({
                arguments: { managed: managedArguments },
                options: { managed: managedOptions },
                context: { directory, verbose },
            }) {
            Severity: Minor
            Found in src/commands/init/index.js - About 55 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 parseCommandOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function parseCommandOptions(command, notManaged) {
                let possibleCommandOptions = [];
                let possibleCommandOptionsShort = [];
                const parsedOptions = {
                    managed: {},
            Severity: Minor
            Found in src/cli/commands/parseOptions.js - About 55 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 settingsToMarkdown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function settingsToMarkdown(name, { settings } = {}, { settings: meta } = {}, filter = []) {
                const documentationObject = sortOnProperty('name', buildDocumentationObject(settings, meta, filter, true));
            
                const header = {
                    name: {
            Severity: Minor
            Found in src/documentation/markdown/settingsToMarkdown.js - About 55 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 buildGroup has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function buildGroup(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
            Severity: Major
            Found in src/documentation/markdown/commandsToMarkdown.js - About 50 mins to fix

              Function buildCommand has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function buildCommand(cli, command, commandData, allSettingGroups, printGroup, parents, level) {
              Severity: Major
              Found in src/documentation/markdown/commandsToMarkdown.js - About 50 mins to fix

                Function commandsToMarkdown has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    name,
                    config = {},
                    commands,
                    settingsLink,
                    mode,
                Severity: Major
                Found in src/documentation/markdown/commandsToMarkdown.js - About 50 mins to fix

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

                          it('should allow undefined and null', () => {
                              expect(isFunction(null))
                                  .toBe(true);
                  
                              expect(isFunction(undefined))
                  Severity: Major
                  Found in test/validation/validators/isFunction.js and 3 other locations - About 50 mins to fix
                  test/validation/validators/isBoolean.js on lines 34..40
                  test/validation/validators/isInteger.js on lines 29..35
                  test/validation/validators/isString.js on lines 29..35

                  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 51.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language