nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function MonthlyCalendar has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function MonthlyCalendar(props) {
    const {
        id,
        className,
        style,
Severity: Major
Found in src/components/MonthlyCalendar/index.js - About 3 hrs to fix

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

        render() {
            const {
                id,
                data,
                sortedBy,
    Severity: Major
    Found in src/components/Table/index.js - About 3 hrs to fix

      Function AccordionTimelineMarker has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function AccordionTimelineMarker(props) {
          const {
              icon,
              name,
              isLoading,
      Severity: Major
      Found in src/components/TimelineMarker/accordionMarker.js - About 3 hrs to fix

        Function disableBodyScroll has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        export function disableBodyScroll(targetElement, options) {
            if (isIosDevice) {
                // targetElement must be provided, and disableBodyScroll must not have been
                // called on this targetElement before.
                if (!targetElement) {
        Severity: Minor
        Found in src/libs/scrollController/index.js - About 3 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 ColorInput has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        const ColorInput = props => {
            const {
                id,
                className,
                style,
        Severity: Minor
        Found in src/components/ColorInput/index.js - About 3 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 render has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function AddRecords has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function AddRecords(props) {
              const { className, style } = props;
              return (
                  <svg
                      className={className}
          Severity: Major
          Found in src/components/ImportRecordsFlow/icons/mergeRecords.js - About 3 hrs to fix

            Function CarouselImage has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            const CarouselImage = props => {
                const { assistiveText, description, header, href, src, style, className } = props;
                const {
                    register,
                    unregister,
            Severity: Minor
            Found in src/components/CarouselImage/index.js - About 3 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

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

            import {
                insertChildOrderly,
                getChildTabNodes,
                getTabIndexFromName,
                getChildrenTotalWidth,
            Severity: Minor
            Found in src/components/Tabset/__test__/utils.spec.js - About 3 hrs to fix

              SingleCalendar has 27 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class SingleCalendar extends Component {
                  constructor(props) {
                      super(props);
                      this.state = {
                          focusedDate: normalizeDate(props.value),
              Severity: Minor
              Found in src/components/Calendar/singleCalendar.js - About 3 hrs to fix

                PageDoubleCalendar has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class PageDoubleCalendar {
                    /**
                     * Create a new PageCalendar page object.
                     * @constructor
                     * @param {string} rootElement - The selector of the PageCalendar root element.
                Severity: Minor
                Found in src/components/Calendar/pageObject/doubleCalendar.js - About 3 hrs to fix

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

                      render() {
                          const {
                              value,
                              disabled,
                              readOnly,
                  Severity: Major
                  Found in src/components/Lookup/selectedValue.js - About 3 hrs to fix

                    Function SidebarItem has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function SidebarItem(props) {
                        const {
                            label,
                            icon,
                            selectedIcon,
                    Severity: Major
                    Found in src/components/SidebarItem/index.js - About 3 hrs to fix

                      Function attachResizeEvent has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function attachResizeEvent(element, resizeListener) {
                          if (!element) {
                              return;
                          }
                          if (element.resizedAttached) {
                      Severity: Major
                      Found in src/libs/ResizeSensor/index.js - About 3 hrs to fix

                        Function Path has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function Path(props) {
                            const { currentStepName, onClick, children, id, className, style } = props;
                            const [hoveredStepName, setHoveredStepName] = useState(null);
                            const [stepsCount, setStepsCount] = useState(0);
                            const registeredSteps = useRef([]);
                        Severity: Major
                        Found in src/components/Path/index.js - About 3 hrs to fix

                          Function attachResizeEvent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function attachResizeEvent(element, resizeListener) {
                              if (!element) {
                                  return;
                              }
                              if (element.resizedAttached) {
                          Severity: Minor
                          Found in src/libs/ResizeSensor/index.js - About 3 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 render has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              render() {
                                  const {
                                      content,
                                      minColumnWidth,
                                      maxColumnWidth,
                          Severity: Major
                          Found in src/components/Table/head/header.js - About 3 hrs to fix

                            Function CheckoutExample has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function CheckoutExample() {
                                return (
                                    <div className="rainbow-align-content_center rainbow-checkout_view-port">
                                        <Card className="rainbow-checkout_card-container" icon={CARD_ICON} title="Checkout">
                                            <div className="rainbow-p-horizontal_x-large rainbow-p-bottom_large rainbow-checkout_media-styles-container">
                            Severity: Major
                            Found in examples/create-react-app/src/pages/Checkout/index.js - About 3 hrs to fix

                              Function Rgba has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const Rgba = React.forwardRef((_props, ref) => {
                                  const { rgba, hsv, hex, tabIndex, onChange } = useContext(ColorPickerContext) || {};
                              
                                  const firstRef = useRef();
                                  const lastRef = useRef();
                              Severity: Major
                              Found in src/components/ColorPicker/commons/rgba/index.js - About 3 hrs to fix

                                Function SingleCalendarHeader has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function SingleCalendarHeader(props) {
                                    const {
                                        monthLabelId,
                                        currentYear,
                                        yearsRange,
                                Severity: Major
                                Found in src/components/Calendar/calendarHeader.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language