nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

function getDesiredPosition(options, alignment, margin) {
    const {
        trigger: {
            leftUpAnchor,
            leftBottomAnchor,
Severity: Minor
Found in src/components/PrimitiveMenu/utils.js - About 1 hr to fix

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

        render() {
            const { currentMonth, currentRange } = this.state;
            const { id, value, onChange, minDate, maxDate, className, style, locale } = this.props;
            const formattedMonth = getFormattedMonth(currentMonth, locale);
            const currentYear = currentMonth.getFullYear();
    Severity: Minor
    Found in src/components/Calendar/singleCalendar.js - About 1 hr to fix

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

      const InputItem = React.forwardRef((props, ref) => {
          const {
              value,
              index,
              disabled,
      Severity: Minor
      Found in src/components/CodeInput/inputItem.js - About 1 hr to fix

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

            constructor(props) {
                super(props);
                const normalizedOptions = getNormalizedOptions(props.options || []);
                this.state = {
                    searchValue: '',
        Severity: Minor
        Found in src/components/Lookup/index.js - About 1 hr to fix

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

              render() {
                  const {
                      items,
                      value,
                      onSelectOption,
          Severity: Minor
          Found in src/components/Lookup/options/index.js - About 1 hr to fix

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

            export default function StackoverflowIcon(props) {
                const { className, style } = props;
            
                return (
                    <svg className={className} style={style} width="89px" height="115px" viewBox="0 0 89 115">
            Severity: Minor
            Found in library/styleguideComponents/RibbonRenderer/stackoverflowIcon.js - About 1 hr to fix

              Function HelpText has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              const HelpText = React.forwardRef((props, ref) => {
                  const { id, title, text, variant, tabIndex, iconSize, className, style } = props;
              
                  const triggerRef = useRef();
                  const helpTextId = useUniqueIdentifier('help-text');
              Severity: Minor
              Found in src/components/HelpText/index.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

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

                      const component = mount(
                          <Table data={data} keyField="name">
                              <Column field="name" header="Name" />
                              <Column field="number" header="Number" />
                          </Table>,
              Severity: Major
              Found in src/components/Table/__test__/table.spec.js and 4 other locations - About 1 hr to fix
              src/components/MultiSelect/__test__/multiSelect.a11y.spec.js on lines 20..25
              src/components/MultiSelect/__test__/multiSelect.spec.js on lines 58..63
              src/components/Table/__test__/table.spec.js on lines 249..254
              src/components/Table/__test__/table.spec.js on lines 311..316

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

                      const component = mount(
                          <Table data={data} keyField="name">
                              <Column field="name" header="Name" />
                              <Column field="number" header="Number" />
                          </Table>,
              Severity: Major
              Found in src/components/Table/__test__/table.spec.js and 4 other locations - About 1 hr to fix
              src/components/MultiSelect/__test__/multiSelect.a11y.spec.js on lines 20..25
              src/components/MultiSelect/__test__/multiSelect.spec.js on lines 58..63
              src/components/Table/__test__/table.spec.js on lines 234..239
              src/components/Table/__test__/table.spec.js on lines 249..254

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

                      const component = mount(
                          <MultiSelect value={value} variant="chip">
                              <Option name="first" label="First" />
                              <Option name="second" label="Second" />
                          </MultiSelect>,
              Severity: Major
              Found in src/components/MultiSelect/__test__/multiSelect.spec.js and 4 other locations - About 1 hr to fix
              src/components/MultiSelect/__test__/multiSelect.a11y.spec.js on lines 20..25
              src/components/Table/__test__/table.spec.js on lines 234..239
              src/components/Table/__test__/table.spec.js on lines 249..254
              src/components/Table/__test__/table.spec.js on lines 311..316

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

                      const component = mount(
                          <MultiSelect value={value} label="Label">
                              <Option name="first" label="First" />
                              <Option name="second" label="Second" />
                          </MultiSelect>,
              src/components/MultiSelect/__test__/multiSelect.spec.js on lines 58..63
              src/components/Table/__test__/table.spec.js on lines 234..239
              src/components/Table/__test__/table.spec.js on lines 249..254
              src/components/Table/__test__/table.spec.js on lines 311..316

              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

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

              export default function Icon({ icon, isVisible, position }) {
                  return (
                      <RenderIf isTrue={isVisible}>
                          <StyledIcon position={position}>{icon}</StyledIcon>
                      </RenderIf>
              Severity: Major
              Found in src/components/MenuItem/icon.js and 1 other location - About 1 hr to fix
              src/components/Option/icon.js 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 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 5 locations. Consider refactoring.
              Open

                      const component = mount(
                          <Table data={data} keyField="name">
                              <Column field="name" header="Name" />
                              <Column field="number" header="Number" />
                          </Table>,
              Severity: Major
              Found in src/components/Table/__test__/table.spec.js and 4 other locations - About 1 hr to fix
              src/components/MultiSelect/__test__/multiSelect.a11y.spec.js on lines 20..25
              src/components/MultiSelect/__test__/multiSelect.spec.js on lines 58..63
              src/components/Table/__test__/table.spec.js on lines 234..239
              src/components/Table/__test__/table.spec.js on lines 311..316

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

                  it('should render the EnumerableCell component when columnType is "WITH_ENUMERABLE"', () => {
                      const component = mount(<Cell value="cell-1" columnType="WITH_ENUMERABLE" />);
                      expect(component.find('EnumerableCell').exists()).toBe(true);
                  });
              Severity: Major
              Found in src/components/Table/body/__test__/cell.spec.js and 3 other locations - About 1 hr to fix
              src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 7..11
              src/components/Table/body/__test__/cell.spec.js on lines 40..43
              src/components/Table/body/__test__/cell.spec.js on lines 48..51

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

                  it('should render an anchor when href is passed', () => {
                      const component = mount(<Breadcrumb label="index" href="index" />);
              
                      expect(component.find('a').exists()).toBe(true);
                  });
              Severity: Major
              Found in src/components/Breadcrumb/__test__/breadcrumb.spec.js and 3 other locations - About 1 hr to fix
              src/components/Table/body/__test__/cell.spec.js on lines 40..43
              src/components/Table/body/__test__/cell.spec.js on lines 44..47
              src/components/Table/body/__test__/cell.spec.js on lines 48..51

              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

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

              export default function Icon({ icon, isVisible, position }) {
                  return (
                      <RenderIf isTrue={isVisible}>
                          <StyledIcon position={position}>{icon}</StyledIcon>
                      </RenderIf>
              Severity: Major
              Found in src/components/Option/icon.js and 1 other location - About 1 hr to fix
              src/components/MenuItem/icon.js 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 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 4 locations. Consider refactoring.
              Open

                  it('should render the SelectableCell component when columnType is "SELECTABLE_CHECKBOX"', () => {
                      const component = mount(<Cell value="cell-1" columnType="SELECTABLE_CHECKBOX" />);
                      expect(component.find('SelectableCell').exists()).toBe(true);
                  });
              Severity: Major
              Found in src/components/Table/body/__test__/cell.spec.js and 3 other locations - About 1 hr to fix
              src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 7..11
              src/components/Table/body/__test__/cell.spec.js on lines 44..47
              src/components/Table/body/__test__/cell.spec.js on lines 48..51

              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

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

                              <div>
                                  <StyledHeader>
                                      <StyledLabel>{label}</StyledLabel>
                                      <StyledDatetime>{datetime}</StyledDatetime>
                                  </StyledHeader>
              Severity: Major
              Found in src/components/TimelineMarker/basicMarker.js and 1 other location - About 1 hr to fix
              src/components/TimelineMarker/accordionMarker.js on lines 102..108

              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

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

                              <div>
                                  <StyledHeader>
                                      <StyledLabel>{label}</StyledLabel>
                                      <StyledDatetime>{datetime}</StyledDatetime>
                                  </StyledHeader>
              Severity: Major
              Found in src/components/TimelineMarker/accordionMarker.js and 1 other location - About 1 hr to fix
              src/components/TimelineMarker/basicMarker.js on lines 22..28

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

                  it('should render the ActionsCell component when columnType is "action"', () => {
                      const component = mount(<Cell value="cell-1" columnType="action" />);
                      expect(component.find('ActionsCell').exists()).toBe(true);
                  });
              Severity: Major
              Found in src/components/Table/body/__test__/cell.spec.js and 3 other locations - About 1 hr to fix
              src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 7..11
              src/components/Table/body/__test__/cell.spec.js on lines 40..43
              src/components/Table/body/__test__/cell.spec.js on lines 44..47

              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

              Severity
              Category
              Status
              Source
              Language