boldr/boldr-ui

View on GitHub
src/Pop/Pop.js

Summary

Maintainability
C
1 day
Test Coverage

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

    Function renderTrigger has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      renderTrigger() {
        const {
          trigger,
          visible,
          onVisibleChange,
    Severity: Minor
    Found in src/Pop/Pop.js - About 1 hr to fix

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

        render() {
          const {
            className,
            wrapperClassName,
            trigger,
      Severity: Minor
      Found in src/Pop/Pop.js - About 1 hr to fix

        Function renderContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          renderContent() {
            const {
              prefix,
              content,
              header,
        Severity: Minor
        Found in src/Pop/Pop.js - About 1 hr to fix

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

            render() {
              const {
                type,
                onConfirm,
                onCancel,
          Severity: Minor
          Found in src/Pop/Pop.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                return null;
            Severity: Major
            Found in src/Pop/Pop.js - About 30 mins to fix

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

                  const {
                    trigger,
                    visible,
                    onVisibleChange,
                    closeOnClickOutside,
              Severity: Major
              Found in src/Pop/Pop.js and 2 other locations - About 1 hr to fix
              src/Button/Button.js on lines 113..123
              src/Select/Popup.js on lines 182..192

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

              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 {
                    prefix,
                    content,
                    header,
                    onConfirm,
              Severity: Major
              Found in src/Pop/Pop.js and 2 other locations - About 50 mins to fix
              src/Dialog/DialogElement.js on lines 45..45
              src/Tag/Tag.js on lines 26..26

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

              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 5 locations. Consider refactoring.
              Open

                  const {
                    type,
                    onConfirm,
                    onCancel,
                    confirmText,
              Severity: Major
              Found in src/Pop/Pop.js and 4 other locations - About 35 mins to fix
              src/Alert/Alert.js on lines 65..65
              src/Anchor/Anchor.js on lines 71..71
              src/Card/CardExpander.js on lines 21..29
              src/Popover/Popover.js on lines 320..328

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

              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

              Parsing error: The keyword 'import' is reserved
              Open

              import React, { Component } from 'react';
              Severity: Minor
              Found in src/Pop/Pop.js by eslint

              For more information visit Source: http://eslint.org/docs/rules/

              There are no issues that match your filters.

              Category
              Status