RSG-Group/rsg-components

View on GitHub

Showing 7 of 167 total issues

Function render has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const props: Object = this.props
    const size: number = props.size
    const state = this.state

Severity: Major
Found in src/Clock.js - About 4 hrs to fix

    Function Button has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function Button (props: Props): React.createElement {
      let sizeId: string
      if (props.sizes) sizeId = props.sizes
      else { sizeId = 'default' }
      let padding = '5px 4px'
    Severity: Major
    Found in src/Button.js - About 2 hrs to fix

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

      export default function ProgressBar (props: Props) {
        // If progressCount is not a number then..
        if (!props.progressCount || typeof props.progressCount !== 'number') {
          throw new ReactInvalidPropException({
            prop: 'progressCount',
      Severity: Minor
      Found in src/ProgressBar.js - About 1 hr to fix

        Function FormBasic has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function FormBasic (props: {}): React.createElement {
          const styles: Object = StyleSheet.create({
            inputStyle: {
              border: '1px solid rgb(128, 128, 128)',
              borderRadius: '3.5px',
        Severity: Minor
        Found in src/FormBasic.js - About 1 hr to fix

          Function render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            render () {
              const props: Object = this.props
              const size: number = props.size
              const state = this.state
          
          
          Severity: Minor
          Found in src/Clock.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 ProgressBar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function ProgressBar (props: Props) {
            // If progressCount is not a number then..
            if (!props.progressCount || typeof props.progressCount !== 'number') {
              throw new ReactInvalidPropException({
                prop: 'progressCount',
          Severity: Minor
          Found in src/ProgressBar.js - About 55 mins 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 Button has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function Button (props: Props): React.createElement {
            let sizeId: string
            if (props.sizes) sizeId = props.sizes
            else { sizeId = 'default' }
            let padding = '5px 4px'
          Severity: Minor
          Found in src/Button.js - About 35 mins 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