rofrischmann/bredon

View on GitHub

Showing 47 of 459 total issues

File __mdnData.js has 5370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export default {
  '-ms-overflow-style': {
    syntax: 'auto | none | scrollbar | -ms-autohiding-scrollbar',
    media: 'interactive',
    inherited: true,
Severity: Major
Found in packages/bredon-validate/src/data/__mdnData.js - About 2 wks to fix

    File valueKeywords.js has 1118 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export default {
      MozAppearance: [
        'none',
        'button',
        'button-arrow-down',
    Severity: Major
    Found in packages/bredon-validate/src/data/valueKeywords.js - About 2 days to fix

      validators has 93 functions (exceeds 20 allowed). Consider refactoring.
      Open

      const validators = {
        MozBinding: isURL,
        MozBorderBottomColors: (node, isMultiValue) =>
          validateNodeList(isColor)(normalizeNodeList(node, isMultiValue)),
        MozBorderLeftColors: (node, isMultiValue) =>
      Severity: Major
      Found in packages/bredon-validate/src/propertyValidators.js - About 1 day to fix

        File propertyValidators.js has 715 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          isInteger,
          isStringLiteral,
          isURL,
          isIdentifier,
        Severity: Major
        Found in packages/bredon-validate/src/propertyValidators.js - About 1 day to fix

          File Parser.js has 430 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* @flow */
          import tokenize from 'tokenize-sync'
          import {
            assignment,
            dimension,
          Severity: Minor
          Found in packages/bredon/src/Parser.js - About 6 hrs to fix

            Function parseIdentifier has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

              parseIdentifier(partial: string = ''): SimpleNode | FunctionNode {
                if (this.currentToken.type === 'identifier') {
                  let nextToken = this.getNextToken(1)
            
                  let ident = partial + this.currentToken.value
            Severity: Minor
            Found in packages/bredon/src/Parser.js - About 5 hrs 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

            File properties.js has 383 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            export default {
              MozAppearance: true,
              MozBackgroundClip: true,
              MozBinding: true,
              MozBorderBottomColors: true,
            Severity: Minor
            Found in packages/bredon-validate/src/data/properties.js - About 5 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                if (isMultiValue) {
                  return (
                    (node.length === 2 &&
                      (((isLengthPercentage(node[0]) ||
                        matchesIdentifier(['left', 'center', 'right'])(node[0])) &&
              Severity: Critical
              Found in packages/bredon-validate/src/types/isPosition.js - About 5 hrs to fix

                File valueInitials.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                export default {
                  msOverflowStyle: 'auto',
                  MozBinding: 'none',
                  MozBorderBottomColors: 'none',
                  MozBorderLeftColors: 'none',
                Severity: Minor
                Found in packages/bredon-validate/src/data/valueInitials.js - About 3 hrs to fix

                  File valueInitials.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  export default {
                    msOverflowStyle: 'auto',
                    MozBinding: 'none',
                    MozBorderBottomColors: 'none',
                    MozBorderLeftColors: 'none',
                  Severity: Minor
                  Found in packages/bredon-plugin-initial/src/valueInitials.js - About 3 hrs to fix

                    Function isValidProperty has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function isValidProperty(
                      property: string,
                      ast: any,
                      isList?: boolean = false
                    ): boolean {
                    Severity: Minor
                    Found in packages/bredon-validate/src/isValidProperty.js - About 2 hrs 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 parseOperator has a Cognitive Complexity of 19 (exceeds 5 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 2 hrs 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 parseIdentifier has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      parseIdentifier(partial: string = ''): SimpleNode | FunctionNode {
                        if (this.currentToken.type === 'identifier') {
                          let nextToken = this.getNextToken(1)
                    
                          let ident = partial + this.currentToken.value
                    Severity: Major
                    Found in packages/bredon/src/Parser.js - About 2 hrs to fix

                      Function parseFloat has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                        parseFloat(integerPart?: number, isNegative?: boolean = false): FloatNode {
                          // floats can also start with a floating point
                          // if the integer part is 0
                          if (this.currentToken.type === 'floating_point') {
                            const nextToken = this.getNextToken(1)
                      Severity: Minor
                      Found in packages/bredon/src/Parser.js - About 2 hrs 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 isValidProperty has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function isValidProperty(
                        property: string,
                        ast: any,
                        isList?: boolean = false
                      ): boolean {
                      Severity: Minor
                      Found in packages/bredon-validate/src/isValidProperty.js - About 1 hr to fix

                        Function generate has 44 lines of code (exceeds 25 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

                          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

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language