piceaTech/ember-rapid-forms

View on GitHub

Showing 11 of 11 total issues

Function _setValueMultiple has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  _setValueMultiple() {
    const selectedEl = this.element.querySelector('select');
    const model = this.get('model');
    if (model) {

Severity: Minor
Found in addon/components/em-select.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 _setValueSingle has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  _setValueSingle() {
    const selectedEl = this.element.querySelector('select');
    const model = this.get('model');
    if (model) {

Severity: Minor
Found in addon/components/em-select.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 _setValueMultiple has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _setValueMultiple() {
    const selectedEl = this.element.querySelector('select');
    const model = this.get('model');
    if (model) {

Severity: Major
Found in addon/components/em-select.js - About 2 hrs to fix

    Function _setValueSingle has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _setValueSingle() {
        const selectedEl = this.element.querySelector('select');
        const model = this.get('model');
        if (model) {
    
    
    Severity: Minor
    Found in addon/components/em-select.js - About 1 hr to fix

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

          get(){
            if(this._label !== undefined){
              return this._label;
            }
            const i18n = this.get('i18n');
      Severity: Minor
      Found in addon/components/em-form-group.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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          get() {
            if(this._validationIcon !== undefined){
              return this._validationIcon;
            }
            if (!this.get('shouldShowErrors')) {
      Severity: Minor
      Found in addon/components/em-form-group.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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          get() {
            if (this.get('form.showErrorsOnSubmit') && !this.get('form.isSubmitted')) {
              return false;
            }
      
      
      Severity: Minor
      Found in addon/components/em-form-submit.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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          get() {
            if (this.get('property')) {
              return this.get('property');
            } else if (this.get('formComponent.property')) {
              return this.get('formComponent.property');
      Severity: Minor
      Found in addon/mixins/has-property.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 _copyErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        _copyErrors(model, attribute) {
          if (model.currentState.stateName === 'root.loaded.saved' || model.currentState.stateName === 'root.deleted.saved') {
            return;
          }
      
      
      Severity: Minor
      Found in addon/mixins/ember-cp-validations-helper.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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          get() {
            if (this.get('cid')) {
              return this.get('cid');
            } else if (this.elementId && this.get('property')) {
              return `${this.get('property')}-${this.elementId}`;
      Severity: Minor
      Found in addon/mixins/has-id.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          get() {
            if (this._controlWrapper) {
              return this._controlWrapper;
            }
            if (this.get('form.formLayout') === 'horizontal') {
      Severity: Minor
      Found in addon/mixins/input-component.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