Showing 145 of 325 total issues
Function Tracker
has a Cognitive Complexity of 311 (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 873 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Tracker(
trackerId: string,
namespace: string,
version: string,
endpoint: string,
Function newTracker
has 851 lines of code (exceeds 25 allowed). Consider refactoring. Open
const newTracker = (
trackerId: string,
namespace: string,
version: string,
endpoint: string,
File index.ts
has 975 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
trackerCore,
buildPagePing,
buildPageView,
CommonEventProperties,
File core.ts
has 671 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 newEmitter
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
export function newEmitter({
endpoint,
eventMethod = 'post',
protocol,
port,
- 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 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 contexts.ts
has 496 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
File api.ts
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BrowserPlugin, BrowserTracker, dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';
import { buildSelfDescribingEvent, resolveDynamicContext, LOG, SelfDescribingJson } from '@snowplow/tracker-core';
import { MediaTracking } from './mediaTracking';
import { MediaPingInterval } from './pingInterval';
import { MediaSessionTracking } from './sessionTracking';
File install-run.js
has 459 lines of code (exceeds 250 allowed). Consider refactoring. Open
// THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED.
//
// This script is intended for usage in an automated build environment where a Node tool may not have
// been preinstalled, or may have an unpredictable version. This script will automatically install the specified
// version of the specified tool (if not already installed), and then pass a command-line to it.
Function trackerCore
has 167 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 newEmitterRequest
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function newEmitterRequest({
endpoint,
protocol = 'https',
port,
eventMethod = 'post',
- 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 newCore
has 148 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,
Function trackerCore
has a Cognitive Complexity of 34 (exceeds 5 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();
- 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 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 29 (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"
Further reading
Function Plugins
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Plugins(configuration: JavaScriptTrackerConfiguration) {
const {
performanceTiming,
gaCookies,
geolocation,
Function 679877
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "isVariableSetInNpmrcFile": () => (/* binding */ isVariableSetInNpmrcFile),
Function globalContexts
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function globalContexts(): GlobalContexts {
let globalPrimitives: Array<ContextPrimitive> = [];
let conditionalProviders: Array<ConditionalContextProvider> = [];
let namedPrimitives: Record<string, ContextPrimitive> = {};
let namedConditionalProviders: Record<string, ConditionalContextProvider> = {};
- 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"