rofrischmann/elodin

View on GitHub

Showing 180 of 180 total issues

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

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

    Function parseStyle has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

        if (node.callee === 'percentage') {
          if (floatingPercentage) {
            return '((' + generateValue(node.params[0], property) + ') / 100)'
          }
      
      
      Severity: Major
      Found in utils/javascript/src/generateValue.js and 1 other location - About 1 hr to fix
      utils/reason/src/generateValue.js on lines 68..82

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

      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 (name && name.charAt(0).toUpperCase() !== name.charAt(0)) {
              this.addError(
                {
                  type: errorTypes.SYNTAX_ERROR,
                  message: 'A style name must begin with an uppercase letter.',
      Severity: Major
      Found in core/parser/src/Parser.js and 1 other location - About 1 hr to fix
      core/parser/src/Parser.js on lines 315..324

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

      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 (node.callee === 'percentage') {
          if (floatingPercentage) {
            return (
              'string_of_int((' +
              generateValue(node.params[0], floatingPercentage) +
      Severity: Major
      Found in utils/reason/src/generateValue.js and 1 other location - About 1 hr to fix
      utils/javascript/src/generateValue.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 70.

      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 (name && name.charAt(0).toUpperCase() !== name.charAt(0)) {
              this.addError(
                {
                  type: errorTypes.SYNTAX_ERROR,
                  message: 'Variant names must begin with an uppercase letter.',
      Severity: Major
      Found in core/parser/src/Parser.js and 1 other location - About 1 hr to fix
      core/parser/src/Parser.js on lines 204..213

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

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

      function generateReasonFile(ast, config, fileName) {
        const {
          devMode,
          generateReasonFileName,
          generateCSSFileName,
      Severity: Minor
      Found in generators/reason-css/src/createGenerator.js - About 1 hr to fix

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

                node.comments.map((comment) => '# ' + comment.trim() + '\n').join('') +
                'variant ' +
                node.name +
                ' {\n' +
                ident.repeat(level) +
        Severity: Major
        Found in core/format/src/formatFromAST.js and 1 other location - About 1 hr to fix
        core/format/src/formatFromAST.js on lines 43..50

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

            if (params.length > validator.params.length) {
              return {
                type: 'length',
                message:
                  callee +
        Severity: Major
        Found in core/parser/src/validateFunction.js and 1 other location - About 1 hr to fix
        core/parser/src/validateFunction.js on lines 75..86

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

                node.comments.map((comment) => '# ' + comment.trim() + '\n').join('') +
                'style ' +
                node.name +
                ' {\n' +
                ident.repeat(level) +
        Severity: Major
        Found in core/format/src/formatFromAST.js and 1 other location - About 1 hr to fix
        core/format/src/formatFromAST.js on lines 56..61

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

            if (params.length < validator.params.length) {
              return {
                type: 'length',
                message:
                  callee +
        Severity: Major
        Found in core/parser/src/validateFunction.js and 1 other location - About 1 hr to fix
        core/parser/src/validateFunction.js on lines 62..73

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

        export default function transformFile(inputPath, config, callback) {
          const { plugins = [], generator, errors = 'throw', log } = config
        
          if (!generator) {
            if (!log) {
        Severity: Minor
        Found in core/core/src/transformFile.js - About 1 hr to fix

          Function generateClassNameMap has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function generateClassNameMap(
            nodes,
            variantMap,
            devMode,
            classes = {},
          Severity: Minor
          Found in utils/css/src/generateClassNameMap.js - About 1 hr to fix

            Function validateDeclaration has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function validateDeclaration(property, value, rawValue) {
              const propertyDefinition = definitions[property]
            
              if (propertyDefinition) {
                let val = value
            Severity: Minor
            Found in core/parser/src/validateDeclaration.js - About 1 hr to fix

              Function log has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  errors.forEach((error) => {
                    const count = ++opts.errorCount
              
                    if (error.type === errorTypes.INVALID_PROPERTY) {
                      const { property, value, path, line, hint } = error
              Severity: Minor
              Found in core/cli/src/util.js - About 1 hr to fix

                Function generateStyles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function generateStyles(
                  nodes,
                  variantMap,
                  devMode,
                  styles = [],
                Severity: Minor
                Found in generators/javascript-react-native/src/createGenerator.js - About 1 hr to fix

                  Function walk has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async function walk(filenames) {
                      console.log(chalk`{cyan >>>> Start compiling}`)
                  
                      const _filenames = []
                      let start = performance.now()
                  Severity: Minor
                  Found in core/cli/src/command.js - About 1 hr to fix

                    Function escapeKeywords has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function escapeKeywords(
                      ast,
                      baseKeywords = [],
                      caseSensitive = false
                    ) {
                    Severity: Minor
                    Found in utils/reason/src/escapeKeywords.js - About 1 hr to fix

                      Function compile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function compile(filename, opts) {
                        const log = (errors) =>
                          errors.forEach((error) => {
                            const count = ++opts.errorCount
                      
                      
                      Severity: Minor
                      Found in core/cli/src/util.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

                      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/javascript/src/__tests__/generateValue-test.js and 1 other location - About 1 hr to fix
                      utils/css/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

                      Severity
                      Category
                      Status
                      Source
                      Language