Showing 9 of 40 total issues
Function analyticsTracker
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function analyticsTracker(options) {
const { metricName, data, navigatorInformation, vitalsScore, eventProperties } = options;
if (navigatorInformation && navigatorInformation.deviceMemory) {
navigatorInformation$.next(navigatorInformation);
isLowEndDevice$.next(navigatorInformation.isLowEndDevice);
Function ngAfterViewInit
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngAfterViewInit() {
navigationTiming.subscribe(result => {
this.navigationTiming = JSON.stringify(result, undefined, 2);
this.ref.detectChanges();
});
Function performance
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
performance: () => {
delete (window as any).performance;
const performance = {
clearMarks: jest.fn(),
// https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName
Function getEntriesByType
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
getEntriesByType: (entryType: string) => {
if (entryType === 'navigation') {
return [
{
connectEnd: 1.7850000876933336,
Function analyticsTracker
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function analyticsTracker(options) {
const { metricName, data, navigatorInformation, vitalsScore, eventProperties } = options;
if (navigatorInformation && navigatorInformation.deviceMemory) {
navigatorInformation$.next(navigatorInformation);
isLowEndDevice$.next(navigatorInformation.isLowEndDevice);
- 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 navigator
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
navigator: () => {
delete (window as any).navigator;
const navigator = {
connection: {
effectiveType: '4g',
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function getNavigatorInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getNavigatorInfo = function(): INavigatorInfo {
if (WN) {
return {
deviceMemory: getDM() || 0,
hardwareConcurrency: getHC() || 0,
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(options: IPerfumeOptions = {}) {
// Extend default config with external options
config.analyticsTracker = options.analyticsTracker;
config.isResourceTiming = !!options.resourceTiming;
config.isElementTiming = !!options.elementTiming;
- 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"