ritz078/react-filters

View on GitHub

Showing 26 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

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

              const {
                      attributes,
                      className,
                      name,
                      label,
          Severity: Major
          Found in components/Toggle/Toggle.jsx and 1 other location - About 1 hr to fix
          components/Slider/Slider.jsx on lines 141..152

          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

              const {
                      name,
                      disabled,
                      step,
                      min,
          Severity: Major
          Found in components/Slider/Slider.jsx and 1 other location - About 1 hr to fix
          components/Toggle/Toggle.jsx on lines 79..90

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

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

              const list = [{
                id: 1,
                title: 'The Great Gatsby',
                author: 'F. Scott Fitzgerald'
              }, {
              Severity: Major
              Found in stories/InputRange.story.js and 1 other location - About 1 hr to fix
              stories/AutoComplete.story.js on lines 7..19

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

              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 list = [{
                id: 1,
                title: 'The Great Gatsby',
                author: 'F. Scott Fitzgerald'
              }, {
              Severity: Major
              Found in stories/AutoComplete.story.js and 1 other location - About 1 hr to fix
              stories/InputRange.story.js on lines 5..17

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

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

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

                        <AutoComplete
                          keys={['author', 'title']}
                          list={suggestions[1]}
                          name={'ir-upper'}
                          onSelect={this.onSelect}
                Severity: Major
                Found in components/InputRange/InputRange.jsx and 1 other location - About 1 hr to fix
                components/InputRange/InputRange.jsx on lines 27..33

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

                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

                function checkBoxElement (p) {
                  const iconClass = classNames({
                    'icon-check-box-outline-blank': !p.value,
                    'icon-check-box': p.value
                  });
                Severity: Major
                Found in components/Toggle/Toggle.jsx and 1 other location - About 1 hr to fix
                components/Toggle/Toggle.jsx on lines 6..12

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

                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

                        <AutoComplete
                          keys={['author', 'title']}
                          list={suggestions[0]}
                          name={'ir-lower'}
                          onSelect={this.onSelect}
                Severity: Major
                Found in components/InputRange/InputRange.jsx and 1 other location - About 1 hr to fix
                components/InputRange/InputRange.jsx on lines 35..41

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

                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

                function radioElement (p) {
                  const iconClass = classNames({
                    'icon-radio-button-unchecked': !p.value,
                    'icon-radio-button-checked': p.value
                  });
                Severity: Major
                Found in components/Toggle/Toggle.jsx and 1 other location - About 1 hr to fix
                components/Toggle/Toggle.jsx on lines 14..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 57.

                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

                storiesOf('Radio Button', module)
                  .addDecorator((story) => <Container action={action} value={false}>{story()}</Container>)
                  .add('Default', () => (
                    <Toggle
                      name='basic'
                Severity: Minor
                Found in stories/Radio.story.js and 1 other location - About 55 mins to fix
                stories/CheckBox.story.js on lines 6..13

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

                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

                storiesOf('Checkbox Button', module)
                  .addDecorator((story) => <Container action={action} value={false}>{story()}</Container>)
                  .add('with a text', () => (
                    <Toggle
                      name='basic'
                Severity: Minor
                Found in stories/CheckBox.story.js and 1 other location - About 55 mins to fix
                stories/Radio.story.js on lines 6..14

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

                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

                    title + '\n' +
                    stringOfLength('-', title.length) + '\n' +
                    '\n' +
                    'prop name | isRequired | type\n-------|------|------\n' +
                      Object.keys(props).sort().map(function (propName) {
                Severity: Minor
                Found in scripts/generateMarkdown.js and 1 other location - About 50 mins to fix
                scripts/generateMarkdown.js on lines 59..68

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

                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

                const value2 = [{
                  id: 1,
                  label: 'a',
                  count: 6
                }, {
                Severity: Minor
                Found in stories/Group.story.js and 1 other location - About 40 mins to fix
                stories/Group.story.js on lines 7..17

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

                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