ember-redux/ember-redux

View on GitHub

Showing 5 of 9 total issues

Function octaneConnect has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function octaneConnect(stateToComputed, dispatchToActions, WrappedComponent) {

  defineProperty(WrappedComponent.prototype, 'redux', inject('redux'));

  return class Connect extends WrappedComponent {
Severity: Minor
Found in addon/octane-connect.js - About 1 hr to fix

    Function octaneConnect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function octaneConnect(stateToComputed, dispatchToActions, WrappedComponent) {
    
      defineProperty(WrappedComponent.prototype, 'redux', inject('redux'));
    
      return class Connect extends WrappedComponent {
    Severity: Minor
    Found in addon/octane-connect.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 core has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function core(stateToComputed, dispatchToActions) {
      const redux = this.get('redux');
    
      if (stateToComputed) {
        const wrappedStateToComputed = wrapStateToComputed(stateToComputed);
    Severity: Minor
    Found in addon/core.js - About 1 hr to fix

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

          constructor() {
            super(...arguments);
            const redux = get(this, 'redux');
      
            if (stateToComputed) {
      Severity: Minor
      Found in addon/octane-connect.js - About 1 hr to fix

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

        export function core(stateToComputed, dispatchToActions) {
          const redux = this.get('redux');
        
          if (stateToComputed) {
            const wrappedStateToComputed = wrapStateToComputed(stateToComputed);
        Severity: Minor
        Found in addon/core.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

        Severity
        Category
        Status
        Source
        Language