ritz078/react-filters

View on GitHub

Showing 9 of 26 total issues

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

  render () {
    const {
            name,
            disabled,
            step,
Severity: Minor
Found in components/Slider/Slider.jsx - About 2 hrs to fix

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

      render () {
        const {
                attributes,
                className,
                name,
    Severity: Minor
    Found in components/Toggle/Toggle.jsx - About 1 hr to fix

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

        render () {
          const {
            onFocus,
            onBlur,
            disabled,
      Severity: Minor
      Found in components/AutoComplete/SearchBox.js - About 1 hr to fix

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

          render () {
            const {
                    name,
                    disabled,
                    placeholder,
        Severity: Minor
        Found in components/AutoComplete/AutoComplete.jsx - About 1 hr to fix

          Function onKeyDown has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            onKeyDown (e) {
              const { selectedIndex, results } = this.state;
              const { name, valueKey, onSelect, multiSelect } = this.props;
          
              if (e.keyCode === 40 && (selectedIndex < results.length - 1)) {
          Severity: Minor
          Found in components/AutoComplete/AutoComplete.jsx - About 1 hr to fix

            Function onKeyDown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              onKeyDown (e) {
                const { selectedIndex, results } = this.state;
                const { name, valueKey, onSelect, multiSelect } = this.props;
            
                if (e.keyCode === 40 && (selectedIndex < results.length - 1)) {
            Severity: Minor
            Found in components/AutoComplete/AutoComplete.jsx - 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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render () {
                const {
                  name,
                  disabled,
                  value,
            Severity: Minor
            Found in components/Count/Count.jsx - About 1 hr to fix

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

                render () {
                  const { name, value, toolTipTemplate, disabled, orientation } = this.props;
              
                  const className = classNames('slider-control', name);
              
              
              Severity: Minor
              Found in components/Slider/Control.js - About 1 hr to fix

                Function Rail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function Rail (props) {
                  const { value, min, max, orientation, isRangeType } = props;
                
                  const difference = isRangeType ? (value[1] - value[0]) : value;
                  const dimensionValue = (difference / (max - min)) * 100;
                Severity: Minor
                Found in components/Slider/Rail.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