mseemann/angular2-mdl

View on GitHub

Showing 40 of 40 total issues

File select.component.spec.ts has 722 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
import { MdlSelectComponent } from "./select.component";
import { Component } from "@angular/core";
import { By } from "@angular/platform-browser";
import {
Severity: Major
Found in projects/select/src/lib/select.component.spec.ts - About 1 day to fix

    File mdl-textfield.component.spec.ts has 651 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { TestBed, waitForAsync } from "@angular/core/testing";
    import { By } from "@angular/platform-browser";
    import { Component } from "@angular/core";
    import {
      DISABLE_NATIVE_VALIDITY_CHECKING,
    Severity: Major
    Found in projects/core/src/lib/textfield/mdl-textfield.component.spec.ts - About 1 day to fix

      File mdl-layout.component.spec.ts has 631 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { TestBed, waitForAsync } from "@angular/core/testing";
      import { By } from "@angular/platform-browser";
      import { Component } from "@angular/core";
      import {
        MdlLayoutComponent,
      Severity: Major
      Found in projects/core/src/lib/layout/mdl-layout.component.spec.ts - About 1 day to fix

        File mdl-dialog.service.spec.ts has 474 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          ComponentFixture,
          inject,
          TestBed,
          waitForAsync,
        Severity: Minor
        Found in projects/core/src/lib/dialog/mdl-dialog.service.spec.ts - About 7 hrs to fix

          File select.component.ts has 395 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            AfterContentInit,
            AfterViewInit,
            ChangeDetectorRef,
            Component,
          Severity: Minor
          Found in projects/select/src/lib/select.component.ts - About 5 hrs to fix

            File mdl-layout.component.ts has 377 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              AfterContentInit,
              Component,
              ContentChild,
              ContentChildren,
            Severity: Minor
            Found in projects/core/src/lib/layout/mdl-layout.component.ts - About 5 hrs to fix

              Function init has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
              Open

              MaterialRipple.prototype.init = function () {
                if (this.element_) {
                  const recentering = this.element_.classList.contains(
                    this.CssClasses_.RIPPLE_CENTER
                  );
              Severity: Minor
              Found in projects/core/src/lib/ripple/ripple.vendor.ts - About 4 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

              MdlTextFieldComponent has 34 functions (exceeds 20 allowed). Consider refactoring.
              Open

              @Component({
                selector: "mdl-textfield",
                template: `
                  <div *ngIf="!icon">
                    <textarea
              Severity: Minor
              Found in projects/core/src/lib/textfield/mdl-textfield.component.ts - About 4 hrs to fix

                File mdl-textfield.component.ts has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                  Component,
                  DoCheck,
                  ElementRef,
                  EventEmitter,
                Severity: Minor
                Found in projects/core/src/lib/textfield/mdl-textfield.component.ts - About 4 hrs to fix

                  MdlSelectComponent has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  @Component({
                    selector: "mdl-select",
                    templateUrl: "select.component.html",
                    encapsulation: ViewEncapsulation.None,
                    providers: [MDL_SELECT_VALUE_ACCESSOR],
                  Severity: Minor
                  Found in projects/select/src/lib/select.component.ts - About 4 hrs to fix

                    MdlLayoutComponent has 29 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @Component({
                      selector: "mdl-layout",
                      template: `
                        <div
                          class="mdl-layout__container"
                    Severity: Minor
                    Found in projects/core/src/lib/layout/mdl-layout.component.ts - About 3 hrs to fix

                      Function init has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      MaterialRipple.prototype.init = function () {
                        if (this.element_) {
                          const recentering = this.element_.classList.contains(
                            this.CssClasses_.RIPPLE_CENTER
                          );
                      Severity: Major
                      Found in projects/core/src/lib/ripple/ripple.vendor.ts - About 3 hrs to fix

                        File mdl-radio.component.spec.ts has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { TestBed, waitForAsync } from "@angular/core/testing";
                        import { By } from "@angular/platform-browser";
                        import { Component, OnInit } from "@angular/core";
                        import { MdlRadioComponent, MdlRadioGroupRegisty } from "./mdl-radio.component";
                        import {
                        Severity: Minor
                        Found in projects/core/src/lib/radio/mdl-radio.component.spec.ts - About 3 hrs to fix

                          Function downHandler_ has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          MaterialRipple.prototype.downHandler_ = function (event) {
                            if (!this.rippleElement_.style.width && !this.rippleElement_.style.height) {
                              const rect = this.element_.getBoundingClientRect();
                              this.boundHeight = rect.height;
                              this.boundWidth = rect.width;
                          Severity: Minor
                          Found in projects/core/src/lib/ripple/ripple.vendor.ts - 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 show has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            show(): void {
                              this.visible = true;
                              // give the dialogs time to draw so that a focus can be set
                              setTimeout(() => {
                                this.internalDialogRef.visible();
                          Severity: Major
                          Found in projects/core/src/lib/dialog/mdl-dialog-host.component.ts - About 2 hrs to fix

                            Function show has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              show(event: Event, mdlButton: MdlButtonComponent): void {
                                this.menuRegistry.hideAllExcept(this);
                            
                                event.stopPropagation();
                            
                            
                            Severity: Major
                            Found in projects/core/src/lib/menu/mdl-menu.component.ts - About 2 hrs to fix

                              File mdl-dialog.service.ts has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import {
                                ComponentFactoryResolver,
                                ComponentRef,
                                EventEmitter,
                                Injectable,
                              Severity: Minor
                              Found in projects/core/src/lib/dialog/mdl-dialog.service.ts - About 2 hrs to fix

                                File fab-menu.component.spec.ts has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
                                import { MdlFabMenuModule } from "./fab-menu.module";
                                import { Component, DebugElement } from "@angular/core";
                                import { By } from "@angular/platform-browser";
                                
                                
                                Severity: Minor
                                Found in projects/fab-menu/src/lib/fab-menu.component.spec.ts - About 2 hrs to fix

                                  Function showSnackbar has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    showSnackbar(
                                      snackbarMessage: IMdlSnackbarMessage
                                    ): Observable<MdlSnackbarComponent> {
                                      const optTimeout = snackbarMessage.timeout || 2750;
                                      const closeAfterTimeout = !!snackbarMessage.closeAfterTimeout;
                                  Severity: Minor
                                  Found in projects/core/src/lib/snackbar/mdl-snackbar.service.ts - About 1 hr to fix

                                    Function onScroll has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      private onScroll(scrollTop: number | undefined) {
                                        if (this.mode !== WATERFALL) {
                                          return;
                                        }
                                    
                                    
                                    Severity: Minor
                                    Found in projects/core/src/lib/layout/mdl-layout.component.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language