boldr/boldr-ui

View on GitHub

Showing 85 of 714 total issues

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

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

    function generatePropType(type) {
      switch (type.name) {
        case 'func':
          return 'function';
    
    
    Severity: Minor
    Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

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

      export default function openDialog(options = {}) {
        if (!isBrowser) {
          return noop;
        }
      
      
      Severity: Minor
      Found in src/Dialog/OpenClose.js - About 1 hr to fix

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

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

          Function ContentPromo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ContentPromo = props => {
            const {
              contentsClassName,
              className,
              children,
          Severity: Minor
          Found in src/ContentPromo/ContentPromo.js - About 1 hr to fix

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

              render() {
                const menuItems = React.Children.map(this.props.children, (child, i) => {
                  const { onClick, ...passThroughProps } = child.props;
                  const onClickWithHide = () => {
                    this.tooltip.hide();
            Severity: Minor
            Found in src/Menu/Menu.js - About 1 hr to fix

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

                render() {
                  const ComponentClass = this.props.componentClass;
              
                  const classes = classNames(
                    {
              Severity: Minor
              Found in src/Layout/Col/Col.js - About 1 hr to fix

                Function hide has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  hide() {
                    this.setState({ hidden: true });
                    if (this._showTimeout) {
                      clearTimeout(this._showTimeout);
                      this._showTimeout = null;
                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 componentWillReceiveProps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  componentWillReceiveProps(nextProps) {
                    super.componentWillReceiveProps && super.componentWillReceiveProps(nextProps);
                    if (nextProps.isActive !== this.props.isActive) {
                      if (this.state.visible && this.props.hideTrigger === 'custom') {
                        if (!nextProps.isActive) {
                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 generatePropDescription has a Cognitive Complexity of 11 (exceeds 5 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

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

                  getOptions(state, props, item, i) {
                    const { value, index } = props;
                    if (Array.isArray(value) && value.indexOf(item.value) > -1) {
                      // rerender
                      if (!state.sItems.find(selected => selected.value === item.value)) {
                Severity: Minor
                Found in src/Select/Select.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 generateProps has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function generateProps(props) {
                  const header = '## Props';
                
                  let text = `${header}
                | Name | Type | Default | Description |
                Severity: Minor
                Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

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

                    render() {
                      const { closed } = this.state;
                      if (closed) {
                        return null;
                      }
                  Severity: Minor
                  Found in src/Alert/Alert.js - About 1 hr to fix

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

                      render() {
                        let { onClose, className, prefix, closeBtn, footer, mask, style, children } = this.props;
                    
                        let Header = this.renderHeader();
                    
                    
                    Severity: Minor
                    Found in src/Dialog/DialogElement.js - About 1 hr to fix

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

                        render() {
                          const { id, children, thumb, removable, onRemove, size, wrap, disabled } = this.props;
                      
                          const className = classNames({
                            'boldrui-tag': true,
                      Severity: Minor
                      Found in src/Tag/Tag.js - About 1 hr to fix

                        Function componentWillReceiveProps has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          componentWillReceiveProps(nextProps) {
                            const { selectedItems } = this.props;
                            const { cid, text, value } = nextProps;
                        
                            if (this.isDelete || this.isAdded) {
                        Severity: Minor
                        Found in src/Select/triggers/TagsTrigger.js - About 1 hr to fix

                          Function Flag has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const Flag = props => {
                            const { className, children, asset, imageWidth, imageAlignment, ...rest } = props;
                            const finalClassName = cxN({
                              'boldrui-flag__wrapper': true,
                              [className]: className && className.length,
                          Severity: Minor
                          Found in src/Flag/Flag.js - About 1 hr to fix

                            Function _adjustArrowPosition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _adjustArrowPosition(placement, moveTo) {
                                if (moveTo) {
                                  const isPositive = moveTo > 0;
                                  const pixels = isPositive ? moveTo : -moveTo;
                                  if (['top', 'bottom'].includes(placement)) {
                            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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                const {
                                  iconClassName,
                                  className,
                                  children,
                            Severity: Minor
                            Found in src/FontIcon/FontIcon.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 withCloseOnEsc has a Cognitive Complexity of 10 (exceeds 5 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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language