Showing 15 of 54 total issues
Function analyticsTracker
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function analyticsTracker(options) {
const { metricName, data, navigatorInformation, rating, attribution } = options;
if (navigatorInformation && navigatorInformation.deviceMemory) {
navigatorInformation$.next(navigatorInformation);
isLowEndDevice$.next(navigatorInformation.isLowEndDevice);
Function ngAfterViewInit
has 73 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 measureStep
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const measureStep = (
step: string,
startMark: string,
endMark: string,
) => {
Function analyticsTracker
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function analyticsTracker(options) {
const { metricName, data, navigatorInformation, rating, attribution } = 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 initPerfume
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const initPerfume = (options: IPerfumeOptions = {}) => {
// Extend default config with external options
config.analyticsTracker = options.analyticsTracker;
config.isResourceTiming = !!options.resourceTiming;
config.isElementTiming = !!options.elementTiming;
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 recordEndMark
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const recordEndMark = (endMark: string) => {
const { navigationSteps, finalMarkToStepsMap } = steps;
const navigationLength = Object.keys(navigationSteps).length;
if (navigationLength === 0) {
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 initPerfume
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const initPerfume = (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"
Further reading
Function getNavigatorInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getNavigatorInfo = (): 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 reportPerf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const reportPerf = (
measureName: string,
data: any,
rating: IVitalsScore,
attribution: object,
- 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 measureStep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const measureStep = (
step: string,
startMark: string,
endMark: 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 setStepsMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const setStepsMap = () => {
if (!config.steps) {
return;
}
resetSteps();
- 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"