bokuweb/react-resizable-decorator

View on GitHub

Showing 5 of 9 total issues

Function resizable has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
Open

export default function resizable(WrappedComponent: ReactClass<*>): ReactClass<{}> {
  class Enhancer extends WrappedComponent {

    props: Props;
    state: State;
Severity: Minor
Found in src/index.js - About 1 day 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 resizable has 216 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function resizable(WrappedComponent: ReactClass<*>): ReactClass<{}> {
  class Enhancer extends WrappedComponent {

    props: Props;
    state: State;
Severity: Major
Found in src/index.js - About 1 day to fix

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

    /* @flow */
    
    /* eslint-disable no-underscore-dangle */
    /* eslint-disable max-len */
    /* eslint-disable no-bitwise */
    Severity: Minor
    Found in src/index.js - About 2 hrs to fix

      Function exports has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (config) => {
        config.set({
          basePath: '',
          frameworks: ['mocha'],
          files: [
      Severity: Major
      Found in karma.conf.js - About 2 hrs to fix

        Function __onResize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            __onResize(event: SyntheticMouseEvent) {
              if (!this.state.__isResizing) return;
              const { clientX, clientY } = event;
              const { __direction, __original, __width, __height } = this.state;
              const { minWidth, minHeight, lockAspectRatio } = this.props;
        Severity: Minor
        Found in src/index.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language