rofrischmann/bredon

View on GitHub

Showing 459 of 459 total issues

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

    while (
      this.isRunning() &&
      (this.currentToken.type !== 'paren' ||
        (this.currentToken.type === 'paren' &&
          this.currentToken.value !== ')') ||
Severity: Major
Found in packages/bredon/src/Parser.js and 1 other location - About 1 hr to fix
packages/bredon/src/Parser.js on lines 481..497

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

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 3 locations. Consider refactoring.
Open

  'flex-flow': {
    syntax: "<'flex-direction'> || <'flex-wrap'>",
    media: 'visual',
    inherited: false,
    animationType: 'discrete',
Severity: Major
Found in packages/bredon-validate/src/data/__mdnData.js and 2 other locations - About 1 hr to fix
packages/bredon-validate/src/data/__mdnData.js on lines 2952..2964
packages/bredon-validate/src/data/__mdnData.js on lines 3017..3029

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

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 walkTokens has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  walkTokens(): Node {
    this.updateCurrentToken()

    // the following token do not return a node
    // but rather add some flags
Severity: Minor
Found in packages/bredon/src/Parser.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if (isMultiValue) {
          return (
            (node.length === 2 &&
              validateUnorderedNodeList([
                node =>
    Severity: Critical
    Found in packages/bredon-validate/src/propertyValidators.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (isMultiValue) {
            return (
              (node.length === 2 &&
                validateUnorderedNodeList([
                  validators.flexGrow,
      Severity: Critical
      Found in packages/bredon-validate/src/propertyValidators.js - About 1 hr to fix

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

            expect(
              traverser.traverse({
                type: 'Value',
                body: [
                  {
        Severity: Major
        Found in packages/bredon/src/__tests__/Traverser-test.js and 1 other location - About 1 hr to fix
        packages/bredon/src/__tests__/Traverser-test.js on lines 138..160

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

        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

          'offset-path': {
            syntax:
              'none | ray( [ <angle> && <size>? && contain? ] ) | <path()> | <url> | [ <basic-shape> || <geometry-box> ]',
            media: 'visual',
            inherited: false,
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 3 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 3911..3924
        packages/bredon-validate/src/data/__mdnData.js on lines 5105..5118
        packages/bredon-validate/src/data/__mdnData.js on lines 5356..5369

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

        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 3 locations. Consider refactoring.
        Open

          position: {
            syntax: 'static | relative | absolute | sticky | fixed',
            media: 'visual',
            inherited: false,
            animationType: 'discrete',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 2 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 4439..4452
        packages/bredon-validate/src/data/__mdnData.js on lines 5064..5077

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

        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

          'mix-blend-mode': {
            syntax: '<blend-mode>',
            media: 'visual',
            inherited: false,
            animationType: 'discrete',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 3 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 4062..4076
        packages/bredon-validate/src/data/__mdnData.js on lines 5105..5118
        packages/bredon-validate/src/data/__mdnData.js on lines 5356..5369

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

        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

          'transform-style': {
            syntax: 'flat | preserve-3d',
            media: 'visual',
            inherited: false,
            animationType: 'discrete',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 3 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 3911..3924
        packages/bredon-validate/src/data/__mdnData.js on lines 4062..4076
        packages/bredon-validate/src/data/__mdnData.js on lines 5356..5369

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

        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 3 locations. Consider refactoring.
        Open

          perspective: {
            syntax: 'none | <length>',
            media: 'visual',
            inherited: false,
            animationType: 'length',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 2 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 4480..4493
        packages/bredon-validate/src/data/__mdnData.js on lines 5064..5077

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

        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 3 locations. Consider refactoring.
        Open

          transform: {
            syntax: 'none | <transform-list>',
            media: 'visual',
            inherited: false,
            animationType: 'transform',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 2 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 4439..4452
        packages/bredon-validate/src/data/__mdnData.js on lines 4480..4493

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

        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

          'z-index': {
            syntax: 'auto | <integer>',
            media: 'visual',
            inherited: false,
            animationType: 'integer',
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 3 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 3911..3924
        packages/bredon-validate/src/data/__mdnData.js on lines 4062..4076
        packages/bredon-validate/src/data/__mdnData.js on lines 5105..5118

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

        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

              traverser.traverse({
                type: 'Value',
                body: [
                  {
                    type: 'FunctionExpression',
        Severity: Major
        Found in packages/bredon/src/__tests__/Traverser-test.js and 1 other location - About 1 hr to fix
        packages/bredon/src/__tests__/Traverser-test.js on lines 137..183

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

        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 isPosition has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function isPosition(node, isMultiValue) {
          if (isMultiValue) {
            return (
              (node.length === 2 &&
                (((isLengthPercentage(node[0]) ||
        Severity: Minor
        Found in packages/bredon-validate/src/types/isPosition.js - About 1 hr 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 generate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          generate(node: ASTNode): string {
            const generateValue = this.generate.bind(this)
            const customGenerator = this.generators[node.type]
        
            if (customGenerator) {
        Severity: Minor
        Found in packages/bredon/src/Generator.js - About 1 hr 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

            const visitor = ({ types }) => ({
              Identifier(path) {
                if (path.node.value === 'flex-start') {
                  path.replaceNode(types.identifier('flex-end'))
                }
        Severity: Major
        Found in packages/bredon/src/__tests__/Traverser-test.js and 1 other location - About 1 hr to fix
        packages/bredon/src/__tests__/Traverser-test.js on lines 5..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 65.

        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 visitor = ({ types }) => ({
              Identifier(path) {
                if (path.node.value === 'flex-start') {
                  path.replaceNode(types.identifier('flex-end'))
                }
        Severity: Major
        Found in packages/bredon/src/__tests__/Traverser-test.js and 1 other location - About 1 hr to fix
        packages/bredon/src/__tests__/Traverser-test.js on lines 77..83

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

        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 5 locations. Consider refactoring.
        Open

          borderInlineEndWidth: (node, isMultiValue) => {
            if (isMultiValue && node.length <= 4) {
              return validateNodeList(
                node => isLength(node) || matchesKeyword('borderInlineEndWidth')(node)
              )
        Severity: Major
        Found in packages/bredon-validate/src/propertyValidators.js and 4 other locations - About 1 hr to fix
        packages/bredon-validate/src/propertyValidators.js on lines 203..211
        packages/bredon-validate/src/propertyValidators.js on lines 223..231
        packages/bredon-validate/src/propertyValidators.js on lines 307..315
        packages/bredon-validate/src/propertyValidators.js on lines 628..636

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

        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 3 locations. Consider refactoring.
        Open

          'break-after': {
            syntax:
              'auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region',
            media: 'paged',
            inherited: false,
        Severity: Major
        Found in packages/bredon-validate/src/data/__mdnData.js and 2 other locations - About 1 hr to fix
        packages/bredon-validate/src/data/__mdnData.js on lines 2047..2060
        packages/bredon-validate/src/data/__mdnData.js on lines 2061..2073

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

        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