rofrischmann/bredon

View on GitHub

Showing 459 of 459 total issues

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

  appearance: {
    syntax: 'auto | none',
    media: 'all',
    inherited: false,
    animationType: 'discrete',
Severity: Major
Found in packages/bredon-validate/src/data/__mdnData.js and 24 other locations - About 1 hr to fix
packages/bredon-validate/src/data/__mdnData.js on lines 705..717
packages/bredon-validate/src/data/__mdnData.js on lines 866..879
packages/bredon-validate/src/data/__mdnData.js on lines 1876..1888
packages/bredon-validate/src/data/__mdnData.js on lines 2101..2113
packages/bredon-validate/src/data/__mdnData.js on lines 2114..2126
packages/bredon-validate/src/data/__mdnData.js on lines 2289..2301
packages/bredon-validate/src/data/__mdnData.js on lines 2302..2315
packages/bredon-validate/src/data/__mdnData.js on lines 2342..2355
packages/bredon-validate/src/data/__mdnData.js on lines 2356..2368
packages/bredon-validate/src/data/__mdnData.js on lines 2369..2383
packages/bredon-validate/src/data/__mdnData.js on lines 2437..2449
packages/bredon-validate/src/data/__mdnData.js on lines 2541..2553
packages/bredon-validate/src/data/__mdnData.js on lines 3143..3157
packages/bredon-validate/src/data/__mdnData.js on lines 3158..3170
packages/bredon-validate/src/data/__mdnData.js on lines 3262..3274
packages/bredon-validate/src/data/__mdnData.js on lines 3289..3301
packages/bredon-validate/src/data/__mdnData.js on lines 4117..4129
packages/bredon-validate/src/data/__mdnData.js on lines 4208..4220
packages/bredon-validate/src/data/__mdnData.js on lines 4494..4506
packages/bredon-validate/src/data/__mdnData.js on lines 4507..4519
packages/bredon-validate/src/data/__mdnData.js on lines 4520..4532
packages/bredon-validate/src/data/__mdnData.js on lines 5036..5048
packages/bredon-validate/src/data/__mdnData.js on lines 5236..5248
packages/bredon-validate/src/data/__mdnData.js on lines 5275..5288

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

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

  isolation: {
    syntax: 'auto | isolate',
    media: 'visual',
    inherited: false,
    animationType: 'discrete',
Severity: Major
Found in packages/bredon-validate/src/data/__mdnData.js and 24 other locations - About 1 hr to fix
packages/bredon-validate/src/data/__mdnData.js on lines 705..717
packages/bredon-validate/src/data/__mdnData.js on lines 853..865
packages/bredon-validate/src/data/__mdnData.js on lines 866..879
packages/bredon-validate/src/data/__mdnData.js on lines 1876..1888
packages/bredon-validate/src/data/__mdnData.js on lines 2101..2113
packages/bredon-validate/src/data/__mdnData.js on lines 2114..2126
packages/bredon-validate/src/data/__mdnData.js on lines 2289..2301
packages/bredon-validate/src/data/__mdnData.js on lines 2302..2315
packages/bredon-validate/src/data/__mdnData.js on lines 2342..2355
packages/bredon-validate/src/data/__mdnData.js on lines 2356..2368
packages/bredon-validate/src/data/__mdnData.js on lines 2369..2383
packages/bredon-validate/src/data/__mdnData.js on lines 2437..2449
packages/bredon-validate/src/data/__mdnData.js on lines 2541..2553
packages/bredon-validate/src/data/__mdnData.js on lines 3143..3157
packages/bredon-validate/src/data/__mdnData.js on lines 3158..3170
packages/bredon-validate/src/data/__mdnData.js on lines 3289..3301
packages/bredon-validate/src/data/__mdnData.js on lines 4117..4129
packages/bredon-validate/src/data/__mdnData.js on lines 4208..4220
packages/bredon-validate/src/data/__mdnData.js on lines 4494..4506
packages/bredon-validate/src/data/__mdnData.js on lines 4507..4519
packages/bredon-validate/src/data/__mdnData.js on lines 4520..4532
packages/bredon-validate/src/data/__mdnData.js on lines 5036..5048
packages/bredon-validate/src/data/__mdnData.js on lines 5236..5248
packages/bredon-validate/src/data/__mdnData.js on lines 5275..5288

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

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

  it('should replace any initial value with the initial keyword if its shorter', () => {
    expect(
      compile('padding-box', {
        plugins: [
          initialPlugin({
packages/bredon-plugin-initial/src/__tests__/initial-test.js on lines 15..26

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

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

export default function isFrames(node) {
  return (
    isFunctionExpression(node) &&
    node.callee === 'frames' &&
    node.params.length === 1 &&
Severity: Major
Found in packages/bredon-validate/src/types/isFrames.js and 1 other location - About 1 hr to fix
packages/bredon-validate/src/types/isRepeat.js on lines 5..12

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

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

  it('should only replace the initial keyword if the actual initial value is shorter', () => {
    expect(
      compile('initial', {
        plugins: [
          initialPlugin({
packages/bredon-plugin-initial/src/__tests__/initial-test.js on lines 28..39

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

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

export default function isRepeat(node) {
  return (
    isFunctionExpression(node) &&
    node.callee === 'repeat' &&
    node.params.length === 1 &&
Severity: Major
Found in packages/bredon-validate/src/types/isRepeat.js and 1 other location - About 1 hr to fix
packages/bredon-validate/src/types/isFrames.js on lines 3..10

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

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

  traverseNode(visitor: Object, node: ASTNode, parentPath: Path) {
    const methods = visitor[node.type]

    const nodePath = createPath(node, parentPath, this.context)

Severity: Minor
Found in packages/bredon/src/Traverser.js - About 1 hr to fix

    Function parseOperator has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      parseOperator(): SimpleNode {
        if (this.currentToken.type === 'operator') {
          if (this.scope === 'expression') {
            return operator(this.currentToken.value)
          }
    Severity: Minor
    Found in packages/bredon/src/Parser.js - About 1 hr to fix

      Function createPath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function createPath(
        node: ASTNode,
        parentPath?: Path,
        context?: Object = {}
      ): Path {
      Severity: Minor
      Found in packages/bredon/src/utils/createPath.js - About 1 hr to fix

        Function walkTokens has a Cognitive Complexity of 11 (exceeds 5 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

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

          parseNumber(
            isNegative?: boolean = false
          ): SimpleNode | DimensionNode | FloatNode {
            if (this.currentToken.type === 'number') {
              const nextToken = this.getNextToken(1)
        Severity: Minor
        Found in packages/bredon/src/Parser.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 unitPlugin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function unitPlugin(config?: Object = {}): Object {
          const configFormats = config.formats || {}
          const precision = config.precision || 4
        
          const formats = {
        Severity: Minor
        Found in packages/bredon-plugin-unit/src/index.js - About 1 hr to fix

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

                    validateUnorderedNodeList([
                      node =>
                        isLengthPercentage(node) ||
                        matchesIdentifier(['left', 'center', 'right'])(node),
                      node =>
          Severity: Major
          Found in packages/bredon-validate/src/propertyValidators.js and 1 other location - About 1 hr to fix
          packages/bredon-validate/src/propertyValidators.js on lines 691..698

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

          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 (!isValidUnit(nextToken.value)) {
                    throw new SyntaxError(
                      `A number (${this.currentToken
                        .value}) must be followed by a valid unit. Instead found "${nextToken.value}" of type "${nextToken.type}".`
                    )
          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 318..323

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

          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 (!isValidUnit(innerNextToken.value)) {
                        throw new SyntaxError(
                          `A float (${this.currentToken
                            .value}) must be followed by a valid unit. Instead found "${innerNextToken.value}" of type "${innerNextToken.type}".`
                        )
          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 267..272

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

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

                    validateUnorderedNodeList([
                      node =>
                        isLengthPercentage(node) ||
                        matchesIdentifier(['left', 'center', 'right'])(node),
                      node =>
          Severity: Major
          Found in packages/bredon-validate/src/propertyValidators.js and 1 other location - About 1 hr to fix
          packages/bredon-validate/src/propertyValidators.js on lines 700..707

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

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

            parseHex(): SimpleNode {
              if (this.currentToken.type === 'hex') {
                this.updateCurrentToken(1)
                let hexValue = ''
          
          
          Severity: Minor
          Found in packages/bredon/src/Parser.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 isPosition has 27 lines of code (exceeds 25 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

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

            export default function initialPlugin(config?: Object = {}): Object {
              const useShorter = config.useShorter || false
            
              return ({ generate, parse, types }) => ({
                Identifier({ node, context, replaceNode }) {
            Severity: Minor
            Found in packages/bredon-plugin-initial/src/index.js - About 1 hr to fix

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

                textDecorationLine: (node, isMultiValue) =>
                  validateUnorderedNodeList([
                    matchesIdentifier(['underline']),
                    matchesIdentifier(['overline']),
                    matchesIdentifier(['line-through']),
              Severity: Minor
              Found in packages/bredon-validate/src/propertyValidators.js and 1 other location - About 50 mins to fix
              packages/bredon-validate/src/propertyValidators.js on lines 392..398

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

              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