Showing 58 of 299 total issues
File teams-view.component.ts
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, OnDestroy, ViewChild, AfterViewChecked, ViewEncapsulation, HostListener } from '@angular/core';
import { CouchService } from '../shared/couchdb.service';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatTab } from '@angular/material/tabs';
File courses.component.ts
has 425 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, AfterViewInit, ViewChild, OnDestroy, HostListener, Input, OnChanges } from '@angular/core';
import { CouchService } from '../shared/couchdb.service';
import { DialogsPromptComponent } from '../shared/dialogs/dialogs-prompt.component';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
CoursesComponent
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'planet-courses',
templateUrl: './courses.component.html',
styleUrls: [ './courses.scss' ]
})
TeamsViewComponent
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
templateUrl: './teams-view.component.html',
styleUrls: [ './teams-view.scss' ],
encapsulation: ViewEncapsulation.None
})
Function generatePDF
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generatePDF() {
const formattedBirthDate = format(new Date(this.user.birthDate), 'MMM d, y');
let contentArray = [
{
text: $localize`${`${this.user.firstName}'s achievements`}`,
ResourcesComponent
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'planet-resources',
templateUrl: './resources.component.html',
styleUrls: [ './resources.scss' ],
encapsulation: ViewEncapsulation.None
File community.component.ts
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, OnDestroy, ViewEncapsulation, HostListener } from '@angular/core';
import { Subject, forkJoin, of, throwError } from 'rxjs';
import { takeUntil, finalize, switchMap, map, catchError, tap } from 'rxjs/operators';
import { StateService } from '../shared/state.service';
import { NewsService } from '../news/news.service';
UserService
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable({
providedIn: 'root'
})
export class UserService {
private user: any = { name: '' };
File exams-view.component.ts
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, OnDestroy, Input } from '@angular/core';
import { CoursesService } from '../courses/courses.service';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Subject, forkJoin, of } from 'rxjs';
import { takeUntil, switchMap, catchError } from 'rxjs/operators';
File manager-dashboard.component.ts
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, isDevMode, OnDestroy } from '@angular/core';
import { UserService } from '../shared/user.service';
import { CouchService } from '../shared/couchdb.service';
import { findDocuments } from '../shared/mangoQueries';
import { switchMap, takeUntil } from 'rxjs/operators';
File resources-add.component.ts
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { UserService } from '../shared/user.service';
import {
FormBuilder,
ReportsService
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable({
providedIn: 'root'
})
export class ReportsService {
TeamsService
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Injectable({
providedIn: 'root'
})
export class TeamsService {
Function aiChatStream
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function aiChatStream(
messages: ChatMessage[],
aiProvider: AIProvider,
assistant: boolean,
callback?: (response: string) => void
- 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
ChatSidebarComponent
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'planet-chat-sidebar',
templateUrl: './chat-sidebar.component.html',
styleUrls: [ './chat-sidebar.scss' ],
})
PlanetTagInputComponent
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
'selector': 'planet-tag-input',
'templateUrl': './planet-tag-input.component.html',
'styleUrls': [ 'planet-tag-input.scss' ],
'providers': [
PlanetTagInputDialogComponent
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
'templateUrl': 'planet-tag-input-dialog.component.html',
'styles': [ `
:host .mat-list-option span {
font-weight: inherit;
CoursesProgressLeaderComponent
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
templateUrl: 'courses-progress-leader.component.html',
styleUrls: [ 'courses-progress.scss' ]
})
export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
Function aiChatNonStream
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
export async function aiChatNonStream(
messages: ChatMessage[],
aiProvider: AIProvider,
assistant: boolean,
context: any = '',
- 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 ngOnInit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
if (this.route.snapshot.data.update) {
this.initUpdate();
}
this.loginForm = this.formBuilder.group({