boldr/boldr-ui

View on GitHub

Showing 85 of 714 total issues

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

  render() {
    const {
      children,
      theme,
      arrowPlacement,
Severity: Minor
Found in src/Tooltip/TooltipContent.js - About 1 hr to fix

    Function createPackageFile has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createPackageFile() {
      return new Promise(resolve => {
        fse.readFile(path.resolve(__dirname, '../../package.json'), 'utf8', (err, data) => {
          if (err) {
            throw err;
    Severity: Minor
    Found in internal/scripts/copy-files.js - About 1 hr to fix

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

        render() {
          const { height, paddingTop, paddingBottom, initialOpen } = this.state;
          const {
            children,
            collapsed,
      Severity: Minor
      Found in src/util/Collapse.js - About 1 hr to fix

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

          render() {
            const ComponentClass = this.props.componentClass;
        
            const classes = classNames(
              {
        Severity: Minor
        Found in src/Layout/Row/Row.js - About 1 hr 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 withNoScroll has a Cognitive Complexity of 14 (exceeds 5 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

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

              render() {
                const { title, onDelete, className, id, ...restProps } = this.props;
                const rest = omit(restProps, ['isOpen', 'onToggle']);
                const { isOpen } = this.state;
                const wrapperClassName = mergeClassNames({
            Severity: Minor
            Found in src/Collapsible/Collapsible.js - About 1 hr to fix

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

              function buildDocs(componentPath) {
                // eslint-disable-next-line global-require, import/no-dynamic-require
                const component = require(componentPath);
              
                const styles = {
              Severity: Minor
              Found in internal/scripts/build-api-docs.js - About 1 hr to fix

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

                export default function withCloseOnEsc(Closable) {
                  return class ESCToCloseWrapper extends Component {
                    static propTypes = {
                      visible: PropTypes.bool.isRequired,
                      onClose: PropTypes.func.isRequired,
                Severity: Minor
                Found in src/Portal/withCloseOnEsc.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 generatePropDescription has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function generatePropDescription(required, description, type) {
                      let deprecated = '';
                    
                      if (type.name === 'custom') {
                        const deprecatedInfo = getDeprecatedInfo(type);
                    Severity: Minor
                    Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

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

                        formateData(data, props) {
                          data = data || this.sourceData;
                          props = props || this.props;
                          const that = this;
                          const { selectedItem, selectedItems } = this.state;
                      Severity: Minor
                      Found in src/Select/Select.js - About 1 hr to fix

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

                          render() {
                            const {
                              iconClassName,
                              className,
                              children,
                        Severity: Minor
                        Found in src/FontIcon/FontIcon.js - About 1 hr to fix

                          Function show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            show() {
                              if (this.props.disabled) {
                                return;
                              }
                              if (this._unmounted) {
                          Severity: Minor
                          Found in src/Tooltip/Tooltip.js - About 1 hr to fix

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

                              render() {
                                const { trigger, content } = this.validateChildren();
                                const {
                                  display,
                                  prefix,
                            Severity: Minor
                            Found in src/Popover/Popover.js - About 1 hr to fix

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

                                render() {
                                  const {
                                    id,
                                    style,
                                    className,
                              Severity: Minor
                              Found in src/Card/CardTitle.js - About 1 hr to fix

                                Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  render() {
                                    const child = this.props.children;
                                    if (child) {
                                      return cloneElement(child, {
                                        ref: ref => (this._childNode = ReactDOM.findDOMNode(ref)),
                                Severity: Minor
                                Found in src/Tooltip/Tooltip.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 locate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
                                  const viewport = getViewportSize();
                                  const { anchorBoundingBoxViewport, cushion } = options;
                                
                                  let horizontal;
                                Severity: Minor
                                Found in src/Popover/placement/auto-top-center.js - About 1 hr to fix

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

                                  function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
                                    const viewport = getViewportSize();
                                    const { anchorBoundingBoxViewport, cushion } = options;
                                  
                                    let horizontal;
                                  Severity: Minor
                                  Found in src/Popover/placement/auto-bottom-center.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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language