Showing 14 of 31 total issues
Function constructor
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private loadPageFunc: LoadPageFunction<T>,
public storageKey?: string,
initialSort: SortChange = {} as SortChange,
initialSearch = '',
Function provideExampleSiteFeature
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function provideExampleSiteFeature() {
return makeEnvironmentProviders([
{
provide: ADMIN_TOPICS,
multi: true,
Function _loadState
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
_loadState() {
if (this.storageKey()) {
const columnsOrder: string[] = this.storage.getValue(
`${this.storageKey()}-columns-order`,
[]
- 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 format
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static format(
value: string | number | Date | DateTime | null | undefined,
format?: string
): string {
if (value) {
- 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 provideAdminFeature
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function provideAdminFeature() {
return makeEnvironmentProviders([
{
provide: APP_FEATURE_ADMIN,
useValue: true
Function _buildFilter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_buildFilter() {
let $lte = DateTime.invalid('not set');
let $gte = DateTime.invalid('not set');
if (this.enabled()) {
- 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 exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
basePath: 'src',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function _loadState
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadState() {
if (this.storageKey()) {
const columnsOrder: string[] = this.storage.getValue(
`${this.storageKey()}-columns-order`,
[]
Function authGuard
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function authGuard(configOrRoles?: string | string[] | Partial<AuthGuardConfig>) {
return (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {
// eslint-disable-next-line deprecation/deprecation
const router = inject(Router);
const sessionService = inject(SessionService);
Function provideTeamsFeature
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function provideTeamsFeature(additionalRoutes?: AdditionalTeamsRoutes) {
return makeEnvironmentProviders([
{
provide: APP_FEATURE_TEAM,
useValue: true
Function handleError
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
handleError<ReturnType>(error: unknown, returnValue: ReturnType) {
if (error instanceof HttpErrorResponse) {
if (error.status === 400 && error.error.errors) {
const vError = error.error.errors.body?.[0] || error.error.errors.query?.[0];
if (vError) {
- 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 transform
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
transform(date: Date | string | number | null | undefined, hideAgo?: boolean): string {
if (null != date) {
let agoDate;
// If it's not null, and it's either a number, string or a date
if (typeof date === 'number') {
- 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 format
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static format(
value: string | number | Date | DateTime | null | undefined,
format?: string
): string {
if (value) {
Function provideAppConfig
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function provideAppConfig() {
return makeEnvironmentProviders([
{
provide: APP_INITIALIZER,
useFactory: (configService: ConfigService) => {