boldr/boldr-ui

View on GitHub

Showing 85 of 714 total issues

Function generatePropType has a Cognitive Complexity of 10 (exceeds 5 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

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 27 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-right.js - About 1 hr to fix

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

      render() {
        const { id, subtitle, avatar } = this.props;
        let { title } = this.props;
        title = (
          <h2
    Severity: Minor
    Found in src/Card/CardTitleBlock.js - About 1 hr to fix

      Function locate has 27 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-left.js - About 1 hr to fix

        Function locate has 27 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-left.js - About 1 hr to fix

          Function locate has 27 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-right.js - About 1 hr to fix

            Function componentDidUpdate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              componentDidUpdate() {
                if (this._mountNode && this.state.visible) {
                  const arrowPlacement = {
                    top: 'bottom',
                    left: 'right',
            Severity: Minor
            Found in src/Tooltip/Tooltip.js - About 1 hr to fix

              Function getShowModifiers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const getShowModifiers = display => {
                const isDefault = str => str === 'default';
                if (typeof display === 'string') {
                  return { [`is-${display}`]: true };
                }
              Severity: Minor
              Found in src/util/boldrui.js - About 1 hr to fix

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

                  render() {
                    const {
                      isLazy,
                      lazyDivideFactor,
                      src,
                Severity: Minor
                Found in src/ResponsiveImage/ResponsiveImage.js - About 55 mins 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  show() {
                    if (this.props.disabled) {
                      return;
                    }
                    if (this._unmounted) {
                Severity: Minor
                Found in src/Tooltip/Tooltip.js - About 45 mins 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 getModifier has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                const getModifier = modifier => {
                  if (modifier === true) {
                    return { 'has-icons-left has-icons-right': true };
                  } else if (typeof modifier === 'string') {
                    return isDirection(modifier) ? { [`has-icons-${modifier}`]: true } : {};
                Severity: Minor
                Found in src/Form/Control.js - About 45 mins 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 handleClick has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  handleClick(key: string | number) {
                    let { activeItems } = this.state;
                    if (this.props.isAccordion) {
                      activeItems = activeItems[0] === key ? [] : [key];
                    } else {
                Severity: Minor
                Found in src/Accordion/Accordion.js - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const { zDepth } = this.state;
                    const {
                      className,
                      raise,
                Severity: Minor
                Found in src/Card/Card.js - About 45 mins 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 a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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 a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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 findPositionedParent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function findPositionedParent(elem, inclusive = false) {
                  function isPositioned(node) {
                    const cs = getComputedStyle(node);
                    const pos = cs.getPropertyValue('position');
                    return pos && pos !== 'static';
                Severity: Minor
                Found in src/util/dom/findPositionedParent.js - About 35 mins 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 getHideModifiers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const getHideModifiers = platform => {
                  if (typeof platform === 'boolean') {
                    return platform ? { 'is-hidden': true } : {};
                  }
                  if (typeof platform === 'string') {
                Severity: Minor
                Found in src/util/boldrui.js - About 35 mins 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 _updatePosition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  _updatePosition(ref) {
                    if (ref && this._childNode) {
                      const tooltipNode = ReactDOM.findDOMNode(ref);
                
                      const style = this._calculatePosition(ref, tooltipNode);
                Severity: Minor
                Found in src/Tooltip/Tooltip.js - About 35 mins 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

                Avoid too many return statements within this function.
                Open

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

                  Function locate has a Cognitive Complexity of 6 (exceeds 5 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-left.js - About 25 mins 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