gabrielbull/react-desktop

View on GitHub

Showing 98 of 257 total issues

Function renderItem has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

  renderItem(item, path = '', subtitle = false) {
    let finalChildren = [];
    for (let prop in item) {
      if (item.hasOwnProperty(prop)) {
        if (typeof item[prop] === 'object') {
Severity: Minor
Found in playground/ui/examples/examples.js - About 4 hrs 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 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { size, color, style, absolute, hidden, ...props } = this.props;

    let containerStyle = { ...styles.container };
    let componentStyle = {
Severity: Major
Found in src/ProgressCircle/macOs/index.js - About 4 hrs to fix

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

      render() {
        return (
          <svg x="0px" y="0px" viewBox="0 0 302.6 49.2" width="116" height="20" style={{ padding: '10px 10px 0 10px' }}>
            <g>
              <path
    Severity: Major
    Found in playground/ui/sidebar/logo.js - About 4 hrs to fix

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

        render() {
          let {
            style,
            label,
            size,
      Severity: Major
      Found in src/TextInput/macOs/index.js - About 4 hrs to fix

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

          render() {
            let {
              style,
              label,
              size,
        Severity: Major
        Found in src/TextArea/macOs/index.js - About 4 hrs to fix

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

            render() {
              let { style, label, color, ...props } = this.props;
              let componentStyle = {
                ...styles.radio,
                ...(this.context.theme === 'dark' ? styles['radioDark'] : {})
          Severity: Minor
          Found in src/Radio/windows/index.js - About 4 hrs 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 styleHelper has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function styleHelper(options, propTypes, mapStyleCallback, mapStylesCallback, mapProps) {
            if (!mapProps || typeof mapProps !== 'function') {
              mapProps = props => props;
            }
          
          
          Severity: Minor
          Found in src/styleHelper.js - About 4 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
          Open

            render() {
              let {
                style,
                label,
                size,
          Severity: Minor
          Found in src/TextInput/macOs/index.js - About 3 hrs 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 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              let { style, label, color, ...props } = this.props;
              let componentStyle = {
                ...styles.radio,
                ...(this.context.theme === 'dark' ? styles['radioDark'] : {})
          Severity: Major
          Found in src/Radio/windows/index.js - About 3 hrs to fix

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

              render() {
                let {
                  style,
                  label,
                  size,
            Severity: Minor
            Found in src/TextArea/macOs/index.js - About 2 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const { style } = this.props;
            
                let children;
                // todo: use Children.map
            Severity: Minor
            Found in src/SegmentedControl/macOs/Tabs/index.js - About 2 hrs 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 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                let {
                  style,
                  onClick,
                  onMaximizeClick,
            Severity: Major
            Found in src/TitleBar/macOs/Controls/Resize.js - About 2 hrs to fix

              Function mapAlignmentStyle has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function mapAlignmentStyle(key, value, props) {
                let finalKey, finalValue;
                if (allowedValues.indexOf(value) === -1) {
                  console.error('Unknown value for ' + key + ': ' + value);
                } else {
              Severity: Minor
              Found in src/style/alignment.js - About 2 hrs 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 applyDefaultProps has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              export function applyDefaultProps(props, context, defaultProps) {
                let finalProps = { ...props };
              
                for (let prop in defaultProps) {
                  if (defaultProps.hasOwnProperty(prop)) {
              Severity: Minor
              Found in src/styleHelper.js - About 2 hrs 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 mapRules has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              function mapRules(selector, style) {
                let styles = { 0: style };
                if (style[':hover']) {
                  styles = { ...styles, ':hover': style[':hover'] };
                  delete styles[0][':hover'];
              Severity: Minor
              Found in src/placeholderStyle.js - About 2 hrs 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 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  let { style, label, isWindowFocused, ...props } = this.props;
                  const { transition } = this.state;
                  let componentStyle = { ...styles.checkbox, ...style };
                  let labelStyle = styles.label;
              Severity: Major
              Found in src/Checkbox/macOs/index.js - About 2 hrs to fix

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

                  render() {
                    let { style, label, isWindowFocused, ...props } = this.props;
                    const { transition } = this.state;
                    let componentStyle = { ...styles.radio, ...style };
                    let labelStyle = styles.label;
                Severity: Major
                Found in src/Radio/macOs/index.js - About 2 hrs to fix

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

                    render() {
                      const isChecked = this.state.theme === 'dark';
                  
                      let colorPicker;
                      if (this.state.displayColorPicker) {
                  Severity: Major
                  Found in playground/ui/sidebar/sidebar.js - About 2 hrs to fix

                    Function mapStyle has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function mapStyle(prevStyles, nextStyles, defaultStyles, styleCallback, stylesCallback, props) {
                      let finalStyles = { ...prevStyles };
                      if (defaultStyles) {
                        for (let key in defaultStyles) {
                          if (defaultStyles.hasOwnProperty(key)) {
                    Severity: Minor
                    Found in src/styleHelper.js - About 2 hrs 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 rotateCircle has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function rotateCircle(circles) {
                      let lastFrame = false;
                      for (var i = 0, len = circles.length; i < len; ++i) {
                        if (this.iteration >= circlesInterval * i) {
                          let iteration = this.iteration - circlesInterval * i;
                    Severity: Minor
                    Found in src/ProgressCircle/windows/progressCircleAnimation.js - About 2 hrs 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