boldr/boldr-ui

View on GitHub

Showing 85 of 714 total issues

Function renderIcon has 850 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderIcon(kind: string) {
    switch (kind) {
      default:
        return null;

Severity: Major
Found in src/Icons/Icon.js - About 4 days to fix

    File Icon.js has 874 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable max-lines, max-len, react/no-unescaped-entities, complexity */
    // @flow
    import React, { PureComponent } from 'react';
    
    import BaseIcon from './BaseIcon';
    Severity: Major
    Found in src/Icons/Icon.js - About 2 days to fix

      Function injectResetStyle has 223 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const injectResetStyle = () => {
        // eslint-disable-next-line no-unused-expressions
        injectGlobal`
         * {
           font-size: inherit;
      Severity: Major
      Found in src/theme/resetStyle.js - About 1 day to fix

        File Popover.test.js has 515 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { Simulate } from 'react-dom/test-utils';
        import { mount } from 'enzyme';
        import Button from '../Button';
        import Popover from './';
        Severity: Major
        Found in src/Popover/Popover.test.js - About 1 day to fix

          File boldrui.test.js has 403 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import { shallow, mount } from 'enzyme';
          
          import * as BoldrUI from './boldrui';
          
          
          Severity: Minor
          Found in src/util/boldrui.test.js - About 5 hrs to fix

            File Tooltip.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* eslint-disable react/no-find-dom-node, no-unused-expressions, no-return-assign */
            import React, { cloneElement } from 'react';
            import PropTypes from 'prop-types';
            import ReactDOM from 'react-dom';
            
            
            Severity: Minor
            Found in src/Tooltip/Tooltip.js - About 4 hrs to fix

              File Select.js has 322 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Select
               */
              
              import React, { Component, Children } from 'react';
              Severity: Minor
              Found in src/Select/Select.js - About 3 hrs to fix

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

                  render() {
                    const {
                      isLazy,
                      lazyDivideFactor,
                      src,
                Severity: Major
                Found in src/ResponsiveImage/ResponsiveImage.js - About 3 hrs to fix

                  Function makeHoverLeaveRecognizer has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function makeHoverLeaveRecognizer({ leaveDelay, onLeave, isOutSide, quirk }) {
                    const state = makeState('leave', onLeave);
                    let recognizer;
                    let timerId;
                  
                  
                  Severity: Minor
                  Found in src/Popover/triggers/HoverTrigger.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

                  File Pop.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, { Component } from 'react';
                  import cx from 'classnames';
                  import noop from 'lodash.noop';
                  import isFunction from 'lodash.isfunction';
                  import PropTypes from 'prop-types';
                  Severity: Minor
                  Found in src/Pop/Pop.js - About 2 hrs to fix

                    Tooltip has 25 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Tooltip extends BoldrComponent {
                      componentElements() {
                        const elements = super.componentElements();
                        return this._mountNode ? elements.concat(this._mountNode) : elements;
                      }
                    Severity: Minor
                    Found in src/Tooltip/Tooltip.js - About 2 hrs to fix

                      File validationRules.test.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import validationRules from '../validationRules';
                      
                      describe('Validation-Rules', () => {
                        // values no use most of the time as arg[0] of validation functions
                        const values = {};
                      Severity: Minor
                      Found in src/Form/__tests__/validationRules.test.js - About 2 hrs to fix

                        File Pop.test.js has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React from 'react';
                        import { mount } from 'enzyme';
                        import { Simulate } from 'react-dom/test-utils';
                        import Button from '../Button';
                        import Pop from './';
                        Severity: Minor
                        Found in src/Pop/Pop.test.js - About 2 hrs to fix

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

                            render() {
                              const {
                                cid,
                                selectedItems,
                                emptyText,
                          Severity: Major
                          Found in src/Select/Popup.js - About 2 hrs to fix

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

                              render() {
                                const { zDepth } = this.state;
                                const {
                                  className,
                                  raise,
                            Severity: Major
                            Found in src/Card/Card.js - About 2 hrs to fix

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

                                render() {
                                  const {
                                    placeholder,
                                    maxToShow,
                                    className,
                              Severity: Major
                              Found in src/Select/Select.js - About 2 hrs to fix

                                File Popover.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /**
                                 * Design:
                                 *
                                 * Popover component is just a shell, responsible for assembling Trigger and Content.
                                 *
                                Severity: Minor
                                Found in src/Popover/Popover.js - About 2 hrs to fix

                                  File boldrui.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  // @flow weak
                                  /* eslint-disable */
                                  import React from 'react';
                                  import classNames from 'classnames';
                                  import { combineModifiers, getDomSafeProps, isBetween, is, isOption } from './helpers';
                                  Severity: Minor
                                  Found in src/util/boldrui.js - About 2 hrs to fix

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

                                      render() {
                                        const { imageSrc, onAddImage, onUpdateImage, onRemoveImage } = this.props;
                                    
                                        const tooltipCommonProps = {
                                          showDelay: 0,
                                    Severity: Major
                                    Found in src/ImageDisplay/ImageDisplay.js - About 2 hrs to fix

                                      Function withNoScroll has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export default function withNoScroll(Portal) {
                                        let portalVisibleCount = 0;
                                        let originalOverflow;
                                      
                                        return class NonScrollableWrapper extends Component {
                                      Severity: Minor
                                      Found in src/Portal/withNoScroll.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language