rofrischmann/elodin

View on GitHub

Showing 180 of 180 total issues

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

const rgb = (r, g, b) => ({
  type: 'FunctionExpression',
  callee: 'rgb',
  params: [
    {
Severity: Major
Found in utils/css/src/__tests__/generateValue-test.js and 1 other location - About 1 hr to fix
utils/javascript/src/__tests__/generateValue-test.js on lines 3..20

Duplicated Code

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

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

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

Tuning

This issue has a mass of 66.

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

  parseStyleBody() {
    const body = []

    if (
      this.currentToken.type === 'curly_bracket' &&
Severity: Minor
Found in core/parser/src/Parser.js - About 1 hr to fix

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

      it('should use a custom style name', () => {
        const ast = parse(style).ast
    
        expect(
          createGenerator({
    generators/reason-css/src/__tests__/createGenerator-test.js on lines 46..54

    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

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

      it('should use a custom style name', () => {
        const ast = parse(style).ast
    
        expect(
          createGenerator({
    Severity: Major
    Found in generators/reason-css/src/__tests__/createGenerator-test.js and 1 other location - About 1 hr to fix
    generators/javascript-css/src/__tests__/createGenerator-test.js on lines 46..54

    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

    Function generateFunction has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generateFunction(node, property, floatingPercentage = false) {
      if (stringFns[node.callee]) {
        return wrapInString(
          node.callee +
            '(' +
    Severity: Minor
    Found in utils/javascript/src/generateValue.js - About 1 hr to fix

      Function generateFunction has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function generateFunction(value, property, unit, floatingPercentage = false) {
        if (value.callee === 'raw') {
          return generateValue(value.params[0], property, false)
        }
      
      
      Severity: Minor
      Found in utils/css/src/generateValue.js - About 1 hr to fix

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

                } else {
                  out +=
                    '  '.repeat(level) +
                    wrapInString(property) +
                    ': ' +
        Severity: Major
        Found in generators/reason-css/src/createGenerator.js and 1 other location - About 1 hr to fix
        generators/reason-css/src/createGenerator.js on lines 318..327

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

        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 (property === 'style') {
                  out +=
                    '  '.repeat(level) +
                    wrapInString(property) +
                    ': ' +
        Severity: Major
        Found in generators/reason-css/src/createGenerator.js and 1 other location - About 1 hr to fix
        generators/reason-css/src/createGenerator.js on lines 327..336

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

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

        export default function createPath(node, parentPath, context) {
          const traverser = visitors => traverse(node, [].concat(visitors), context)
        
          const restoredParentPath = parentPath || context.parentPath
          // if we don't have a parentPath (AST entry)
        Severity: Minor
        Found in core/traverser/src/createPath.js - About 1 hr to fix

          Function parseConditional has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parseConditional() {
              if (
                this.currentToken.type === 'square_bracket' &&
                this.currentToken.value === '['
              ) {
          Severity: Minor
          Found in core/parser/src/Parser.js - About 1 hr to fix

            Function parseVariantBody has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              parseVariantBody() {
                const body = []
            
                if (
                  this.currentToken.type === 'curly_bracket' &&
            Severity: Minor
            Found in core/parser/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

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

                          ol: ({ children }) => (
                            <Box
                              as="ol"
                              space={1}
                              marginTop={2.5}
            Severity: Major
            Found in website/components/DocLayout.js and 1 other location - About 1 hr to fix
            website/components/DocLayout.js on lines 257..266

            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

                          ul: ({ children }) => (
                            <Box
                              as="ul"
                              space={1}
                              marginTop={2.5}
            Severity: Major
            Found in website/components/DocLayout.js and 1 other location - About 1 hr to fix
            website/components/DocLayout.js on lines 267..276

            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

            Function traverseNode has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function traverseNode(node, visitor, parentPath) {
              const methods = visitor[node.type]
            
              const nodePath = createPath(node, parentPath, parentPath.context)
            
            
            Severity: Minor
            Found in core/traverser/src/traverseNode.js - About 1 hr to fix

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

                const variantMap = variants.reduce((flatVariants, variant) => {
                  flatVariants[variant.name] = variant.body.map(
                    (variation) => variation.value
                  )
              
              
              Severity: Major
              Found in generators/reason-css/src/createGenerator.js and 1 other location - About 1 hr to fix
              generators/reason-css/src/createGenerator.js on lines 182..188

              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 generate js files with baseClassName', () => {
                  const ast = parse(style).ast
              
                  expect(
                    createGenerator({
              generators/reason-css/src/__tests__/createGenerator-test.js on lines 101..110

              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

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

                const variantMap = variants.reduce((flatVariants, variant) => {
                  flatVariants[variant.name] = variant.body.map(
                    (variation) => variation.value
                  )
              
              
              Severity: Major
              Found in generators/reason-css/src/createGenerator.js and 1 other location - About 1 hr to fix
              generators/reason-css/src/createGenerator.js on lines 89..95

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 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 generate a reason file with baseClassName', () => {
                  const ast = parse(style).ast
              
                  expect(
                    createGenerator({
              Severity: Major
              Found in generators/reason-css/src/__tests__/createGenerator-test.js and 1 other location - About 1 hr to fix
              generators/javascript-css/src/__tests__/createGenerator-test.js on lines 100..109

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

                parseNumber(isNegative = false) {
                  if (this.currentToken.type === 'number') {
                    const integer = this.currentToken.value
              
                    const nextToken = this.getNextToken(1)
              Severity: Minor
              Found in core/parser/src/Parser.js - About 1 hr to fix

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

                    provideCompletionItems(document, position, token, context) {
                      if (
                        context.triggerCharacter === ':' ||
                        context.triggerCharacter === '@'
                      ) {
                Severity: Minor
                Found in core/language-elodin/index.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language