vgno/roc-config

View on GitHub

Showing 571 of 571 total issues

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

        toUpdate.dependencies.forEach((dependency) => {
            console.log(dependency);
            newPackageJSON.dependencies[dependency] = officialExtensions[dependency];
        });
Severity: Minor
Found in src/commands/lock.js and 1 other location - About 50 mins to fix
src/commands/lock.js on lines 19..22

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

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

        it('should allow undefined and null', () => {
            expect(isString(null))
                .toBe(true);

            expect(isString(undefined))
Severity: Major
Found in test/validation/validators/isString.js and 3 other locations - About 50 mins to fix
test/validation/validators/isBoolean.js on lines 34..40
test/validation/validators/isFunction.js on lines 33..39
test/validation/validators/isInteger.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

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

        it('should allow undefined and null', () => {
            expect(isBoolean(null))
                .toBe(true);

            expect(isBoolean(undefined))
Severity: Major
Found in test/validation/validators/isBoolean.js and 3 other locations - About 50 mins to fix
test/validation/validators/isFunction.js on lines 33..39
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

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

            const converter =
                option.converter ||
                getInfoObject(option.validator).converter ||
                (option.default !== undefined && automatic(option.default));
Severity: Minor
Found in src/cli/commands/parseOptions.js and 1 other location - About 50 mins to fix
src/cli/commands/parseArguments.js on lines 30..33

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

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

            const converter =
                argument.converter ||
                getInfoObject(argument.validator).converter ||
                (argument.default !== undefined && automatic(argument.default));
Severity: Minor
Found in src/cli/commands/parseArguments.js and 1 other location - About 50 mins to fix
src/cli/commands/parseOptions.js on lines 132..135

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

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

        toUpdate.devDependencies.forEach((dependency) => {
            console.log(dependency);
            newPackageJSON.devDependencies[dependency] = officialExtensions[dependency];
        });
Severity: Minor
Found in src/commands/lock.js and 1 other location - About 50 mins to fix
src/commands/lock.js on lines 14..17

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

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

        it('should allow undefined and null', () => {
            expect(isInteger(null))
                .toBe(true);

            expect(isInteger(undefined))
Severity: Major
Found in test/validation/validators/isInteger.js and 3 other locations - About 50 mins to fix
test/validation/validators/isBoolean.js on lines 34..40
test/validation/validators/isFunction.js on lines 33..39
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

Function buildDocumentationObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function buildDocumentationObject(
    initalObject,
    initalMeta = {},
    initalFilter = [],
    markdown = false,
Severity: Minor
Found in src/documentation/buildDocumentationObject.js - About 45 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 automatic has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function automatic(value) {
    if (isBoolean(value)) {
        return (input) => toBoolean(input);
    } else if (isRegExp(value)) {
        return toRegExp;
Severity: Minor
Found in src/converters/automatic.js - About 45 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 init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function init(roc, state) {
    if (roc.init) {
        const result = roc.init({
            context: state.context,
            localDependencies: state.dependencyContext.extensionsDependencies[roc.name],
Severity: Minor
Found in src/context/extensions/steps/getExtensions.js - About 45 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 generateCommandDocumentation has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

export default function generateCommandDocumentation(settings, metaSettings, metaCommands, command, name, parents) {
Severity: Minor
Found in src/cli/commands/documentation/generateCommandDocumentation.js - About 45 mins to fix

    Function recursiveHelper has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function recursiveHelper(object, meta = {}, filter = [], level = 0, initalParents = [], leaves = false) {
    Severity: Minor
    Found in src/documentation/buildDocumentationObject.js - About 45 mins to fix

      Function verifyConfigurationStructure has a Cognitive Complexity of 8 (exceeds 5 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 45 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 checkDirectory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export default async function checkDirectory(name = '', directory = '', { force = false } = {}) {
          const directoryPath = getAbsolutePath(name, directory) || directory;
      
          if (folderExists(directoryPath) && name) {
              log.warn(`Found a folder named ${chalk.underline(directoryPath)}, will try to use it.`);
      Severity: Minor
      Found in src/commands/init/checkFolder.js - About 45 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

      Avoid deeply nested control flow statements.
      Open

                                          if (validationResult !== true) {
                                              try {
                                                  throwValidationError(
                                                      `action in ${actionExtensionName} for ${name}`,
                                                      validationResult,
      Severity: Major
      Found in src/hooks/runHookDirectly.js - About 45 mins to fix

        Function validateConfigurationStructure has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            name, intersections, extensionConfigPaths, stateConfigPaths, extensionMeta, stateMeta
        Severity: Minor
        Found in src/context/extensions/helpers/processConfig.js - About 45 mins to fix

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

                      expect(isObject(validator)(null, true))
                          .toEqual({
                              type: 'Object(Type)',
                              required: false,
                              canBeEmpty: true,
          Severity: Minor
          Found in test/validation/validators/isObject.js and 1 other location - About 45 mins to fix
          test/validation/validators/notEmpty.js on lines 21..28

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

          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 (roc.actions) {
                      state.context.actions = registerActions(roc.actions, roc.name, state.context.actions);
                  }
          Severity: Minor
          Found in src/context/extensions/helpers/processRocObject.js and 1 other location - About 45 mins to fix
          src/context/extensions/helpers/processRocObject.js on lines 83..85

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

          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 (roc.hooks) {
                      state.context.hooks = registerHooks(roc.hooks, roc.name, state.context.hooks);
                  }
          Severity: Minor
          Found in src/context/extensions/helpers/processRocObject.js and 1 other location - About 45 mins to fix
          src/context/extensions/helpers/processRocObject.js on lines 92..94

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

          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

                      expect(notEmpty(validator)(null, true))
                          .toEqual({
                              type: 'Type',
                              required: false,
                              canBeEmpty: false,
          Severity: Minor
          Found in test/validation/validators/notEmpty.js and 1 other location - About 45 mins to fix
          test/validation/validators/isObject.js on lines 23..30

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

          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