nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

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

    render() {
        const {
            style,
            className,
            label,
Severity: Minor
Found in src/components/RadioGroup/index.js - About 1 hr to fix

    Function extractExamples has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const extractExamples = file => {
        const code = fs.readFileSync(file.path).toString();
        const componentName = file.path.match(/src\/components\/([a-zA-Z]+)\/readme.md$/i)[1];
        const examples = [];
        const myPlugin = () => {
    Severity: Minor
    Found in scripts/search/extractExamples.js - About 1 hr to fix

      Function disableBodyScroll has 40 lines of code (exceeds 25 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 1 hr to fix

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

            render() {
                const { label, className, variant, name, numbersMap, tooltip } = this.props;
                const { stepState, isTooltipVisible } = this.state;
        
                const shouldRenderNumber =
        Severity: Minor
        Found in src/components/ProgressStep/index.js - About 1 hr to fix

          Function withReduxForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function withReduxForm(WrappedComponent) {
              return class extends Component {
                  constructor(props) {
                      super(props);
                      this.fieldRef = React.createRef();
          Severity: Minor
          Found in src/libs/hocs/withReduxForm/index.js - About 1 hr to fix

            Function SignInExample has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function SignInExample() {
                return (
                    <div className="rainbow-align-content_center rainbow-flex_column rainbow-sign-in_view-port">
                        <img
                            className="rainbow-m-bottom_x-large rainbow-sign-in_logo"
            Severity: Minor
            Found in examples/create-react-app/src/pages/SignIn/index.js - About 1 hr to fix

              Function DirectionalFooter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function DirectionalFooter(props) {
                  const {
                      onBack,
                      onNext,
                      currentStep,
              Severity: Minor
              Found in src/components/ImportRecordsFlow/footer.js - About 1 hr to fix

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

                export default function File(props) {
                    const { className, style } = props;
                    return (
                        <svg
                            className={className}
                Severity: Minor
                Found in src/components/ImportRecordsFlow/icons/file.js - About 1 hr to fix

                  Function Drawer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function Drawer(props) {
                      const {
                          id,
                          isOpen,
                          hideCloseButton,
                  Severity: Minor
                  Found in src/components/Drawer/index.js - About 1 hr 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 useKeyboardNavigation has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function useKeyboardNavigation(
                      country,
                      list,
                      ref,
                      scrollableRef,

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

                  const PhoneInput = React.forwardRef((props, ref) => {
                      const {
                          value,
                          name,
                          placeholder,
                  Severity: Minor
                  Found in src/components/PhoneInput/index.js - About 1 hr 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 manageTab has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function manageTab(node, event) {
                      const tabbable = findTabbableElements(node);
                  
                      if (!tabbable.length) {
                          event.preventDefault();
                  Severity: Minor
                  Found in src/libs/manageTab/index.js - About 1 hr 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 handleChangeHour has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      handleChangeHour(event) {
                          const { hour } = this.state;
                          const { hour24 } = this.props;
                          const { value } = event.target;
                          let normalizedValue;
                  Severity: Minor
                  Found in src/components/TimePicker/timeSelect.js - About 1 hr 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 getColumns has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function getColumns(params) {
                      const {
                          children = [],
                          showCheckboxColumn,
                          showRowNumberColumn,
                  Severity: Minor
                  Found in src/components/Table/helpers/columns/getColumns.js - About 1 hr 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      render() {
                          const { label, description, style, assistiveText, children, className } = this.props;
                          const { isExpanded } = this.state;
                          const sectionMaxHeight = {
                              maxHeight: getMaxHeight(children, isExpanded),
                  Severity: Minor
                  Found in src/components/VerticalSectionOverflow/index.js - About 1 hr to fix

                    Function Twitter has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Twitter = props => {
                        const { className, style } = props;
                        return (
                            <svg
                                className={className}
                    Severity: Minor
                    Found in library/exampleComponents/Icons/twitter.js - About 1 hr to fix

                      Function ButtonMenu has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function ButtonMenu(props) {
                          const {
                              label,
                              icon,
                              iconPosition,
                      Severity: Minor
                      Found in src/components/ButtonMenu/index.js - About 1 hr to fix

                        Function Label has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function Label(props) {
                            const {
                                className,
                                label,
                                required,
                        Severity: Minor
                        Found in src/components/Input/label/index.js - About 1 hr to fix

                          Function handleSelectRow has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              handleSelectRow(event, isMultiple, rowKeyValue) {
                                  const { onRowSelection } = this.props;
                                  const { indexes } = this;
                                  const { rows } = this.state;
                                  const maxRowSelection = this.getMaxRowSelection();
                          Severity: Minor
                          Found in src/components/Table/index.js - About 1 hr to fix

                            Function getRowsWithInitalSelectedRows has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function getRowsWithInitalSelectedRows(params = {}) {
                                const { rows = [], selectedRows, maxRowSelection, indexes, selectedRowsKeys = {} } = params;
                            
                                if (Array.isArray(selectedRows) && maxRowSelection > 0) {
                                    const previousSelectionLength = getCurrentSelectionLength(selectedRowsKeys);
                              Severity
                              Category
                              Status
                              Source
                              Language