akserg/angular2-ui-bootstrap

View on GitHub

Showing 10 of 37 total issues

Function requestHide has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    static requestHide(element:HTMLElement, desiredDuration:number,
        effect:VisibleEffect, effectTiming:CssEffectTiming):Promise<VisibleResult> {

        global.assert(element);
        global.assert(desiredDuration);
Severity: Minor
Found in src/effects/visible-effect-manager.ts - 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 requestHide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static requestHide(element:HTMLElement, desiredDuration:number,
        effect:VisibleEffect, effectTiming:CssEffectTiming):Promise<VisibleResult> {

        global.assert(element);
        global.assert(desiredDuration);
Severity: Minor
Found in src/effects/visible-effect-manager.ts - About 1 hr to fix

    Function requestShow has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static requestShow(element:HTMLElement, desiredDuration:number, effect:VisibleEffect, effectTiming:CssEffectTiming):Promise<VisibleResult> {
    
            global.assert(element);
            global.assert(desiredDuration);
            global.assert(effect);
    Severity: Minor
    Found in src/effects/visible-effect-manager.ts - About 1 hr to fix

      Function computePropertyValue has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        computePropertyValue(fractionComplete:number, element:HTMLElement):string {
          if (fractionComplete >= 1) {
            return 'translate3d(0,0,0)';
          }
          var offset = `${(1 - fractionComplete) * 100}`;
      Severity: Minor
      Found in src/effects/slide-effect.ts - About 1 hr to fix

        Function getToggleState has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            static getToggleState(action:VisibleAction, state:VisibleState):boolean {
                if (action === VisibleAction.SHOW) {
                    return true;
                } if (action === VisibleAction.HIDE) {
                    return false;
        Severity: Minor
        Found in src/effects/visible-effect-manager.ts - 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 requestShow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            static requestShow(element:HTMLElement, desiredDuration:number, effect:VisibleEffect, effectTiming:CssEffectTiming):Promise<VisibleResult> {
        
                global.assert(element);
                global.assert(desiredDuration);
                global.assert(effect);
        Severity: Minor
        Found in src/effects/visible-effect-manager.ts - 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

        Avoid too many return statements within this function.
        Open

                    return Promise.resolve(VisibleResult.IMMEDIATE);
        Severity: Major
        Found in src/effects/visible-effect-manager.ts - About 30 mins to fix

          Function computePropertyValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            computePropertyValue(fractionComplete:number, element:HTMLElement):string {
              if (ShrinkEffect.isHorizontal(this.orientation)) {
                return fractionComplete <= 0 ? '0' : element.scrollWidth * fractionComplete + 'px';
              } else {
                return fractionComplete <= 0 ? '0' : element.scrollHeight * fractionComplete + 'px';
          Severity: Minor
          Found in src/effects/shrink-effect.ts - 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

          Function computeFractionComplete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            computeFractionComplete(element:HTMLElement):number {
              if (ShrinkEffect.isHorizontal(this.orientation)) {
                if (element.scrollWidth > 0) {
                  return Math.min(1, element.clientWidth / element.scrollWidth);
                }
          Severity: Minor
          Found in src/effects/shrink-effect.ts - 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

          Function getDefaultDisplay has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              static getDefaultDisplay(nodeName:string):string {
                  let storedValue:string = Dom._elemDisplay[nodeName];
                  if (storedValue) {
                      return storedValue;
                  } else {
          Severity: Minor
          Found in src/utils/dom.ts - 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