Showing 153 of 352 total issues
Function Tracker
has a Cognitive Complexity of 287 (exceeds 5 allowed). Consider refactoring. Open
export function Tracker(
trackerId: string,
namespace: string,
version: string,
endpoint: 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 Tracker
has 827 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Tracker(
trackerId: string,
namespace: string,
version: string,
endpoint: string,
Function newTracker
has 805 lines of code (exceeds 25 allowed). Consider refactoring. Open
const newTracker = (
trackerId: string,
namespace: string,
version: string,
endpoint: string,
Function OutQueueManager
has a Cognitive Complexity of 193 (exceeds 5 allowed). Consider refactoring. Open
export function OutQueueManager(
id: string,
sharedSate: SharedState,
useLocalStorage: boolean,
eventMethod: string | boolean,
- 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
File index.ts
has 928 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
trackerCore,
buildPagePing,
buildPageView,
CommonEventProperties,
Function OutQueueManager
has 408 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function OutQueueManager(
id: string,
sharedSate: SharedState,
useLocalStorage: boolean,
eventMethod: string | boolean,
Function OptimizelyPlugin
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
export function OptimizelyPlugin(
summary: boolean = true,
experiments: boolean = true,
states: boolean = true,
variations: boolean = true,
- 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
File core.ts
has 652 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Function InQueueManager
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
export function InQueueManager(functionName: string, asyncQueue: Array<unknown>): Queue {
const windowAlias = window,
documentAlias = document,
sharedState: SharedState = createSharedState(),
availableTrackerIds: Array<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 OptimizelyPlugin
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function OptimizelyPlugin(
summary: boolean = true,
experiments: boolean = true,
states: boolean = true,
variations: boolean = true,
Function InQueueManager
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function InQueueManager(functionName: string, asyncQueue: Array<unknown>): Queue {
const windowAlias = window,
documentAlias = document,
sharedState: SharedState = createSharedState(),
availableTrackerIds: Array<string> = [],
File api.ts
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BrowserPlugin, BrowserTracker, dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';
import { buildSelfDescribingEvent, LOG, SelfDescribingJson } from '@snowplow/tracker-core';
import { MediaTracking } from './mediaTracking';
import { MediaPingInterval } from './pingInterval';
import { MediaSessionTracking } from './sessionTracking';
File out_queue.ts
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { attemptWriteLocalStorage, isString } from '../helpers';
import { SharedState } from '../state';
import { localStorageAccessible } from '../detectors';
import { LOG, Payload } from '@snowplow/tracker-core';
import { PAYLOAD_DATA_SCHEMA } from './schemata';
File contexts.ts
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Function trackerCore
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function trackerCore(configuration: CoreConfiguration = {}): TrackerCore {
function newCore(base64: boolean, corePlugins: Array<CorePlugin>, callback?: (PayloadData: PayloadBuilder) => void) {
const pluginContextsHelper: PluginContexts = pluginContexts(corePlugins),
globalContextsHelper: GlobalContexts = globalContexts();
Function Plugins
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Plugins(configuration: JavaScriptTrackerConfiguration) {
const {
performanceTiming,
gaCookies,
geolocation,
Function newCore
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
function newCore(base64: boolean, corePlugins: Array<CorePlugin>, callback?: (PayloadData: PayloadBuilder) => void) {
const pluginContextsHelper: PluginContexts = pluginContexts(corePlugins),
globalContextsHelper: GlobalContexts = globalContexts();
let encodeBase64 = base64,
File install-run.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See the @microsoft/rush package's LICENSE file for license information.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Function runMediaPluginFunction
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function runMediaPluginFunction(
player: MediaPlayer,
trackedPlayer: TrackedPlayer,
eventType: EventType,
eventData: EventData | unknown = {},
Function Plugins
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function Plugins(configuration: JavaScriptTrackerConfiguration) {
const {
performanceTiming,
gaCookies,
geolocation,
- 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"