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 {
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,
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,
File mdl-dialog.service.spec.ts
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ComponentFixture,
inject,
TestBed,
waitForAsync,
File select.component.ts
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
AfterContentInit,
AfterViewInit,
ChangeDetectorRef,
Component,
File mdl-layout.component.ts
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
AfterContentInit,
Component,
ContentChild,
ContentChildren,
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
);
- Read upRead up
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
File mdl-textfield.component.ts
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Component,
DoCheck,
ElementRef,
EventEmitter,
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],
MdlLayoutComponent
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: "mdl-layout",
template: `
<div
class="mdl-layout__container"
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
);
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 {
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;
- Read upRead up
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();
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();
File mdl-dialog.service.ts
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
ComponentFactoryResolver,
ComponentRef,
EventEmitter,
Injectable,
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";
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;
Function onScroll
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private onScroll(scrollTop: number | undefined) {
if (this.mode !== WATERFALL) {
return;
}
- Read upRead up
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"