nexxtway/react-rainbow

View on GitHub
library/pages/CustomizationPage/index.js

Summary

Maintainability
F
4 days
Test Coverage

Function CustomizationPage has 220 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function CustomizationPage(props) {
    const { examples, name, exampleMode, codeRevision } = props;
    const [activeTab, setActiveTab] = useState('overview');
    const example5Ref = useRef();
    const example7Ref = useRef();
Severity: Major
Found in library/pages/CustomizationPage/index.js - About 1 day to fix

    File index.js has 390 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable react/no-unescaped-entities, import/no-extraneous-dependencies */
    import React, { useState, useContext, useRef } from 'react';
    import PropTypes from 'prop-types';
    import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
    import { faList } from '@fortawesome/free-solid-svg-icons';
    Severity: Minor
    Found in library/pages/CustomizationPage/index.js - About 5 hrs to fix

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

                              <section ref={example5Ref}>
                                  <h3 className="react-rainbow-customization_section-heading">
                                      How customize the main color for all the components on my app?
                                  </h3>
                                  <Playground
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 2 other locations - About 4 hrs to fix
      library/pages/CustomizationPage/index.js on lines 362..376
      library/pages/CustomizationPage/index.js on lines 377..391

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

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

                              <section ref={example7Ref}>
                                  <h3 className="react-rainbow-customization_section-heading">
                                      How to do a variation with a specific color for only one component
                                      on my app?
                                  </h3>
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 2 other locations - About 4 hrs to fix
      library/pages/CustomizationPage/index.js on lines 348..361
      library/pages/CustomizationPage/index.js on lines 377..391

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

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

                              <section ref={example9Ref}>
                                  <h3 className="react-rainbow-customization_section-heading">
                                      How use the colors defined on the theme on my own elements of my
                                      app?
                                  </h3>
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 2 other locations - About 4 hrs to fix
      library/pages/CustomizationPage/index.js on lines 348..361
      library/pages/CustomizationPage/index.js on lines 362..376

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

      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

                              <Playground
                                  code={examples[1].content}
                                  evalInContext={examples[1].evalInContext}
                                  key={`${codeRevision}/1`}
                                  name={name}
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 1 other location - About 2 hrs to fix
      library/styleguideComponents/Examples/index.js on lines 19..27

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

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

      CustomizationPage.propTypes = {
          examples: PropTypes.array.isRequired,
          name: PropTypes.string.isRequired,
          exampleMode: PropTypes.string.isRequired,
          codeRevision: PropTypes.number.isRequired,
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 2 other locations - About 1 hr to fix
      library/styleguideComponents/ReactComponent/index.js on lines 160..165
      src/components/Tree/expandCollapseButton.js on lines 31..36

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

      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

                              <div className="rainbow-flex rainbow-align_end">
                                  <h2 className="react-rainbow-customization_section-heading-2">
                                      Theme API
                                  </h2>
                                  <Badge
      Severity: Minor
      Found in library/pages/CustomizationPage/index.js and 1 other location - About 55 mins to fix
      library/pages/CustomizationPage/index.js on lines 273..281

      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

                              <div className="rainbow-flex rainbow-align_end">
                                  <h2 className="react-rainbow-customization_section-heading-2">
                                      Theme generate API
                                  </h2>
                                  <Badge
      Severity: Minor
      Found in library/pages/CustomizationPage/index.js and 1 other location - About 55 mins to fix
      library/pages/CustomizationPage/index.js on lines 232..240

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

                                  <div className="react-rainbow-customization_section-heading-container">
                                      <h3 className="react-rainbow-getting-started_section-heading rainbow-m-right_medium">
                                          If you are using React Rainbow on your app, sometimes you may
                                          need to customize the default styles to satisfy your UI/UX based
                                          on business or brand requirements. Either you will need to use
      Severity: Major
      Found in library/pages/CustomizationPage/index.js and 4 other locations - About 40 mins to fix
      library/pages/Designs/index.js on lines 38..41
      library/pages/ExperienceExamplesPage/index.js on lines 12..17
      library/pages/GettingStartedPage/index.js on lines 87..94
      library/pages/GettingStartedPage/index.js on lines 134..140

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

      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

      There are no issues that match your filters.

      Category
      Status