Showing 40 of 40 total issues
Function calcStyle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public calcStyle(
offsetWidth: number,
offsetHeight: number,
props: ClientRect,
position: string
- 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 downHandler_
has 39 lines of code (exceeds 25 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;
Function setRippleStyles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.setRippleStyles = function (start) {
if (this.rippleElement_ !== null) {
let transformString;
let scale;
let size;
Function calculateCoordinates
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private calculateCoordinates(
forElement: HTMLElement,
popoverElement: HTMLElement,
position: string
): IPositionCoordinates | null {
Function calcStyle
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public calcStyle(
offsetWidth: number,
offsetHeight: number,
props: ClientRect,
position: string
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
show(): Observable<MdlDialogReference> {
if (this.isShown) {
throw new Error("Only one instance of an embedded mdl-dialog can exist!");
}
this.isShown = true;
Function ngAfterContentInit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngAfterContentInit(): void {
this.validateMode();
if (this.header && this.content && this.content.tabs) {
this.header.tabs = this.content.tabs;
Function show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
show(event: Event, mdlButton: MdlButtonComponent): void {
this.menuRegistry.hideAllExcept(this);
event.stopPropagation();
- 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 writeValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public writeValue(value: string | string[] | undefined): void {
if (this.multiple) {
this.model = this.model || [];
if (!value || this.model === value) {
// skip ngModel update when undefined value or multiple selects initialized with same array
- 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
Avoid deeply nested control flow statements. Open
if (recentering) {
offset =
"translate(" +
this.boundWidth / 2 +
"px, " +
Function showSnackbar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
showSnackbar(
snackbarMessage: IMdlSnackbarMessage
): Observable<MdlSnackbarComponent> {
const optTimeout = snackbarMessage.timeout || 2750;
const closeAfterTimeout = !!snackbarMessage.closeAfterTimeout;
- 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 a Cognitive Complexity of 7 (exceeds 5 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();
- 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 renderValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private renderValue(value: string | string[] | undefined) {
if (this.multiple) {
this.text = ((value as string[]) || [])
.map((valueItem: string) => this.textByValue[stringifyValue(valueItem)])
.join(", ");
- 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 applyClip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private applyClip(height: number | undefined, width: number | undefined) {
if (!this.menuElement) {
return;
}
if (this.position === UNALIGNED) {
- 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 onArrow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private onArrow($event: KeyboardEvent, offset: number) {
const arr = this.optionComponents
?.toArray()
.filter(({ disabled }) => !disabled);
if (!arr) {
- 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 checkValidity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private checkValidity() {
// check the global setting - if globally disabled do no check
if (this.nativeCheckGlobalDisabled === true) {
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"
Further reading
Function onKeyDown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@HostListener("keydown", ["$event"])
public onKeyDown($event: KeyboardEvent): void {
if (!this.disabled && this.popoverComponent?.isVisible && !this.multiple) {
if (isKey($event, KEYS.upArrow)) {
this.onArrow($event, -1);
- 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
TODO found Open
// TODO(sgomes): Replace with an icon button when we have that component.
- Exclude checks
TODO found Open
// TODO: In some cases (Retina displays), this is big enough to render the
- Exclude checks
HACK found Open
* HACK: Even though the intention is to have the current .mdl-spinner__layer-N
- Exclude checks