gabrielbull/react-desktop

View on GitHub

Showing 257 of 257 total issues

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

  render() {
    let {
      children,
      inset,
      controls,
Severity: Major
Found in src/TitleBar/macOs/index.js - About 2 hrs to fix

    Function default has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (borderRadius) {
      return keyframes(
        {
          '0%': {
            opacity: '0',
    Severity: Major
    Found in src/TextInput/macOs/focusRingAnimation.js - About 2 hrs to fix

      Function default has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function (borderRadius) {
        return keyframes(
          {
            '0%': {
              opacity: '0',
      Severity: Major
      Found in src/TextArea/macOs/focusRingAnimation.js - About 2 hrs to fix

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

          render() {
            let { style, label, color, ...props } = this.props;
            let componentStyle = { ...styles.checkbox };
            let checkedStyle = { display: 'none' };
            let textStyle = { ...styles.text };
        Severity: Major
        Found in src/Checkbox/windows/index.js - About 2 hrs to fix

          File index.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { Component, cloneElement } from 'react';
          import PropTypes from 'prop-types';
          import ReactDOM from 'react-dom';
          import Radium, { StyleRoot } from 'radium';
          import styles from './styles/10.11';
          Severity: Minor
          Found in src/TextInput/macOs/index.js - About 2 hrs to fix

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

              render() {
                let {
                  style,
                  onClick,
                  onMaximizeClick,
            Severity: Minor
            Found in src/TitleBar/macOs/Controls/Resize.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 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                let {
                  label,
                  labelColor,
                  labelStyle,
            Severity: Major
            Found in src/TextInput/windows/index.js - About 2 hrs to fix

              File index.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component, cloneElement } from 'react';
              import PropTypes from 'prop-types';
              import ReactDOM from 'react-dom';
              import Radium, { StyleRoot } from 'radium';
              import styles from './styles/10.11';
              Severity: Minor
              Found in src/TextArea/macOs/index.js - About 2 hrs to fix

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

                  render() {
                    let {
                      label,
                      labelColor,
                      labelStyle,
                Severity: Minor
                Found in src/TextArea/windows/index.js - About 2 hrs to fix

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

                    render() {
                      const { size, style, absolute, hidden, ...props } = this.props;
                  
                      let containerStyle = { ...styles.container };
                      let componentStyle = {
                  Severity: Minor
                  Found in src/ProgressCircle/windows/index.js - About 2 hrs to fix

                    Function render has 48 lines of code (exceeds 25 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 1 hr to fix

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

                        render() {
                          let { horizontalAlignment, children, style, direction, layout, ...props } = this.props;
                      
                          let componentStyle = { ...styles, ...style };
                      
                      
                      Severity: Minor
                      Found in src/View/windows/index.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 os has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function os() {
                        // explicitly set these to avoid issues
                        const w = window || null;
                        const n = navigator || null;
                        const p = process || (w && w.process) || null;
                      Severity: Minor
                      Found in src/os.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 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          let { horizontalAlignment, children, style, direction, layout, ...props } = this.props;
                          let componentStyle = { ...styles, ...style };
                      
                          if (direction) {
                      Severity: Minor
                      Found in src/View/macOs/index.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

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

                          if (this.context.theme === 'dark' || this.context.background && isDarkColor(this.context.background)) {
                            svgFill = '#ffffff';
                            componentStyle = { ...componentStyle, ...styles.buttonColorBackground };
                          }
                      Severity: Major
                      Found in src/TitleBar/windows/Controls/Minimize.js and 2 other locations - About 1 hr to fix
                      src/TitleBar/windows/Controls/Close.js on lines 55..58
                      src/TitleBar/windows/Controls/Maximize.js on lines 71..74

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

                      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

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

                          if (this.context.theme === 'dark' || this.context.background && isDarkColor(this.context.background)) {
                            svgFill = '#ffffff';
                            componentStyle = { ...componentStyle, ...styles.buttonColorBackground };
                          }
                      Severity: Major
                      Found in src/TitleBar/windows/Controls/Close.js and 2 other locations - About 1 hr to fix
                      src/TitleBar/windows/Controls/Maximize.js on lines 71..74
                      src/TitleBar/windows/Controls/Minimize.js on lines 67..70

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

                      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

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

                          if (this.context.theme === 'dark' || this.context.background && isDarkColor(this.context.background)) {
                            svgFill = '#ffffff';
                            componentStyle = { ...componentStyle, ...styles.buttonColorBackground };
                          }
                      Severity: Major
                      Found in src/TitleBar/windows/Controls/Maximize.js and 2 other locations - About 1 hr to fix
                      src/TitleBar/windows/Controls/Close.js on lines 55..58
                      src/TitleBar/windows/Controls/Minimize.js on lines 67..70

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

                      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

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

                        render() {
                          const { title, icon, selected, onSelect, push, isPaneExpanded } = this.props;
                      
                          let componentStyle = styles.anchor;
                          let spanStyle = styles.span;
                      Severity: Minor
                      Found in src/NavPane/windows/Pane/Item/index.js - About 1 hr to fix

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

                          render() {
                            const { style, isWindowFocused, ...props } = this.props;
                        
                            delete props.onMaximizeClick;
                            delete props.onRestoreDownClick;
                        Severity: Minor
                        Found in src/TitleBar/windows/Controls/Maximize.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language