SymphonyPlatformSolutions/symphony-ui-toolkit

View on GitHub

Showing 262 of 262 total issues

File DatePicker.tsx has 519 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as PropTypes from 'prop-types';
import * as React from 'react';
import { createPortal } from 'react-dom';
import { Component, createRef } from 'react';
import { clsx } from 'clsx';
Severity: Major
Found in packages/components/src/components/date-picker/DatePicker.tsx - About 1 day to fix

    File DayPicker.tsx has 446 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as PropTypes from 'prop-types';
    import * as React from 'react';
    import { clsx } from 'clsx';
    
    import { Modifier } from '../model/Modifiers';

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

        render() {
          const {
            hideSelectedOptions,
            closeMenuOnSelect,
            displayArrowIndicator,
      Severity: Major
      Found in packages/components/src/components/dropdown/Dropdown.tsx - About 6 hrs to fix

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

        module.exports = {
            // Specify custom Selenium Grid url (see usage below)
            // In most cases you don't need this option
            gridUrl: 'http://localhost:4444/wd/hub',
            storybookUrl: 'http://localhost:6006',
        Severity: Major
        Found in packages/styles/.creevey/config.js and 3 other locations - About 5 hrs to fix
        packages/styles/.creevey/config_condensed.js on lines 3..29
        packages/styles/.creevey/config_darkmode.js on lines 3..29
        packages/styles/.creevey/config_darkmode_condensed.js on lines 3..29

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

        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

        module.exports = {
            // Specify custom Selenium Grid url (see usage below)
            // In most cases you don't need this option
            gridUrl: 'http://localhost:4444/wd/hub',
            storybookUrl: 'http://localhost:6006',
        Severity: Major
        Found in packages/styles/.creevey/config_darkmode_condensed.js and 3 other locations - About 5 hrs to fix
        packages/styles/.creevey/config.js on lines 3..29
        packages/styles/.creevey/config_condensed.js on lines 3..29
        packages/styles/.creevey/config_darkmode.js on lines 3..29

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

        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

        module.exports = {
            // Specify custom Selenium Grid url (see usage below)
            // In most cases you don't need this option
            gridUrl: 'http://localhost:4444/wd/hub',
            storybookUrl: 'http://localhost:6006',
        Severity: Major
        Found in packages/styles/.creevey/config_darkmode.js and 3 other locations - About 5 hrs to fix
        packages/styles/.creevey/config.js on lines 3..29
        packages/styles/.creevey/config_condensed.js on lines 3..29
        packages/styles/.creevey/config_darkmode_condensed.js on lines 3..29

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

        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

        module.exports = {
            // Specify custom Selenium Grid url (see usage below)
            // In most cases you don't need this option
            gridUrl: 'http://localhost:4444/wd/hub',
            storybookUrl: 'http://localhost:6006',
        Severity: Major
        Found in packages/styles/.creevey/config_condensed.js and 3 other locations - About 5 hrs to fix
        packages/styles/.creevey/config.js on lines 3..29
        packages/styles/.creevey/config_darkmode.js on lines 3..29
        packages/styles/.creevey/config_darkmode_condensed.js on lines 3..29

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

        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

        File TimePicker.tsx has 369 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Dropdown } from '../dropdown';
        import * as React from 'react';
        import { useEffect, useMemo, useState } from 'react';
        import { Keys } from '../common/eventUtils';
        import { ErrorMessages } from '../validation/interfaces';
        Severity: Minor
        Found in packages/components/src/components/time-picker/TimePicker.tsx - About 4 hrs to fix

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

          export function matchDayMin(day: Date, matcher: Modifier | Modifier[]): boolean {
            if (!matcher) return false;
            let matchers: Modifier[];
          
            if (Array.isArray(matcher)) {
          packages/components/src/components/date-picker/utils/matchDayUtils.tsx on lines 101..117

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

          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

          export function matchDayMax(day: Date, matcher: Modifier | Modifier[]): boolean {
            if (!matcher) return false;
            let matchers: Modifier[];
          
            if (Array.isArray(matcher)) {
          packages/components/src/components/date-picker/utils/matchDayUtils.tsx on lines 80..96

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

          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 debounce has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

          export function debounce(func: any, wait?: any, options?: any): any {
            let lastArgs,
              lastThis,
              maxWait,
              result,
          Severity: Minor
          Found in packages/components/src/utils/debounce.ts - About 4 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 debounce has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function debounce(func: any, wait?: any, options?: any): any {
            let lastArgs,
              lastThis,
              maxWait,
              result,
          Severity: Major
          Found in packages/components/src/utils/debounce.ts - About 3 hrs to fix

            File Dropdown.tsx has 309 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import * as React from 'react';
            import { CSSProperties } from 'react';
            import Select, { ActionMeta, createFilter } from 'react-select';
            import CreatableSelect from 'react-select/creatable';
            import AsyncSelect from 'react-select/async';
            Severity: Minor
            Found in packages/components/src/components/dropdown/Dropdown.tsx - About 3 hrs to fix

              Function renderBody has 85 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderBody() {
                  const {
                    dir,
                    locale,
                    selectedDays,

                File timeUtils.tsx has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { format as formatTime, parse as parseTime, isValid } from 'date-fns';
                
                import Time from './Time';
                import { DisabledTime, TimePickerOption } from '../interfaces';
                
                
                Severity: Minor
                Found in packages/components/src/components/time-picker/utils/timeUtils.tsx - About 3 hrs to fix

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

                  const SvgBell = (props: SVGProps<SVGSVGElement>) => (
                    <svg
                      data-testid="ICON_BELL"
                      width="1em"
                      height="1em"
                  Severity: Major
                  Found in packages/components/src/components/icons/Bell.tsx and 2 other locations - About 3 hrs to fix
                  packages/components/src/components/icons/AnimalsAndNature.tsx on lines 3..15
                  packages/components/src/components/icons/Signals.tsx on lines 3..15

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

                  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

                  const SvgAnimalsAndNature = (props: SVGProps<SVGSVGElement>) => (
                    <svg
                      data-testid="ICON_ANIMALS-AND-NATURE"
                      width="1em"
                      height="1em"
                  packages/components/src/components/icons/Bell.tsx on lines 3..15
                  packages/components/src/components/icons/Signals.tsx on lines 3..15

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

                  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

                  const SvgSignals = (props: SVGProps<SVGSVGElement>) => (
                    <svg
                      data-testid="ICON_SIGNALS"
                      width="1em"
                      height="1em"
                  Severity: Major
                  Found in packages/components/src/components/icons/Signals.tsx and 2 other locations - About 3 hrs to fix
                  packages/components/src/components/icons/AnimalsAndNature.tsx on lines 3..15
                  packages/components/src/components/icons/Bell.tsx on lines 3..15

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

                  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 handleKeyDownCell has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    handleKeyDownCell(e: React.KeyboardEvent, date: Date, modifers): void {
                      const { locale, dir } = this.props;
                      const { currentMonth } = this.state;
                      if (e.key !== Keys.ESC) {
                        cancelEvent(e);

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

                      render() {
                        const {
                          id,
                          disabled,
                          format,
                    Severity: Major
                    Found in packages/components/src/components/date-picker/DatePicker.tsx - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language