nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function Accordion has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Accordion = props => {
    const { id, children, style, className, activeSectionNames, multiple, onToggleSection } = props;
    const containerRef = useRef();

    const [activeNames, setActiveNames] = useState(activeSectionNames);
Severity: Major
Found in src/components/Accordion/index.js - About 2 hrs to fix

    Function StepThree has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function StepThree(props) {
        const { attributes, columns, onAssignField, fieldsMap, data, matchField, borderRadius } = props;
        const previewData = data.slice(0, 3);
    
        const [assignData, setAssignData] = useState([]);
    Severity: Major
    Found in src/components/ImportRecordsFlow/stepThree/index.js - About 2 hrs to fix

      Function CustomWorkIcon has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const CustomWorkIcon = props => {
          const { className } = props;
          return (
              <svg className={className} width="24px" height="22px" viewBox="0 0 24 22" version="1.1">
                  <g id="pages" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
      Severity: Major
      Found in library/styleguideComponents/ComponentsList/icons/customWorkIcon.js - About 2 hrs to fix

        Function File has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const File = props => {
            const { className, style } = props;
            return (
                <svg className={className} style={style} width="16px" height="20px" viewBox="0 0 16 20">
                    <g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
        Severity: Major
        Found in library/exampleComponents/Icons/file.js - About 2 hrs to fix

          Function filterCountries has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function filterCountries(query, countries, country) {
              if (query === '' || query === '+') {
                  const filteredCountries = countries.filter(value => value.isoCode !== country.isoCode);
                  filteredCountries.unshift(country);
                  return filteredCountries;

          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

          File tableWithBrowserPagination.spec.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import { mount } from 'enzyme';
          import TableWithBrowserPagination from '../index';
          import Pagination from '../../Pagination';
          import Table from '../../Table';

            Function renderCards has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                renderCards() {
                    const {
                        forms,
                        dataViews,
                        layouts,
            Severity: Major
            Found in library/pages/ComponentsPage/index.js - About 2 hrs to fix

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

                  render() {
                      const {
                          title,
                          style,
                          className,
              Severity: Major
              Found in src/components/Modal/index.js - About 2 hrs to fix

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

                    render() {
                        const { isOpen } = this.state;
                        const { componentLibraryVersion, prismicLibraryVersion } = this.state;
                        return (
                            <ul
                Severity: Major
                Found in library/styleguideComponents/ProjectSelector/index.js - About 2 hrs to fix

                  Function User has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const User = props => {
                      const { className, style } = props;
                      return (
                          <svg
                              className={className}
                  Severity: Major
                  Found in library/exampleComponents/Icons/user.js - About 2 hrs to fix

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

                        render() {
                            const {
                                style,
                                label,
                                children,
                    Severity: Major
                    Found in src/components/Button/index.js - About 2 hrs to fix

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

                          render() {
                              const {
                                  label,
                                  value,
                                  name,
                      Severity: Major
                      Found in src/components/Slider/index.js - About 2 hrs to fix

                        Function Row has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function Row(props) {
                            const { rowData, columns, isSelected, ...rest } = props;
                        
                            const cells = columns.map((column, index) => {
                                const {
                        Severity: Major
                        Found in src/components/Table/body/row.js - About 2 hrs to fix

                          Function RibbonRenderer has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function RibbonRenderer() {
                              return (
                                  <StyledHeading>
                                      <UniversalSearch />
                                      <StyledContainer>
                          Severity: Major
                          Found in library/styleguideComponents/RibbonRenderer/index.js - About 2 hrs to fix

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

                                render() {
                                    const {
                                        style,
                                        className,
                                        label,
                            Severity: Major
                            Found in src/components/GoogleAddressLookup/component.js - About 2 hrs to fix

                              Function getColumns has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function getColumns(params) {
                                  const {
                                      children = [],
                                      showCheckboxColumn,
                                      showRowNumberColumn,
                              Severity: Major
                              Found in src/components/Table/helpers/columns/getColumns.js - About 2 hrs to fix

                                Function getUpdatedRowsWhenSelect has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function getUpdatedRowsWhenSelect(params = {}) {
                                    const {
                                        maxRowSelection,
                                        rows = [],
                                        indexes = {},
                                Severity: Major
                                Found in src/components/Table/helpers/selector/getUpdatedRowsWhenSelect.js - About 2 hrs to fix

                                  Function InteractiveExamples has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const InteractiveExamples = props => {
                                      const { className } = props;
                                      return (
                                          <svg
                                              className={className}
                                  Severity: Major
                                  Found in library/pages/components/FeatureList/images/interactive-examples.js - About 2 hrs to fix

                                    Function toBeFocusable has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export default function toBeFocusable(component) {
                                        if (component && isMountedByEnzyme(component)) {
                                            const onClickMockFn = jest.fn();
                                            const onBlurMockFn = jest.fn();
                                            const onFocusMockFn = jest.fn();
                                    Severity: Minor
                                    Found in jestMatchers/toBeFocusable.js - About 2 hrs 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 useArrowKeyNav has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export default function useArrowKeyNav({ childrenRefs, isLoading }) {
                                        const [focusedChildIndex, setFocusedChildIndex] = useState(null);
                                    
                                        const focusChild = useCallback(
                                            index => {
                                    Severity: Minor
                                    Found in src/components/PrimitiveMenu/hooks/useArrowKeyNav.js - About 2 hrs 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