snowplow/snowplow-javascript-tracker

View on GitHub

Showing 199 of 352 total issues

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentPending(consent: ConsentEventProperties, trackers: Array<string> = Object.keys(_trackers)) {
  trackConsentAction({ ...consent, eventType: 'pending' }, trackers);
}
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 61..63
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 72..77
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 97..102
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 111..113
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 122..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentAllow(consent: ConsentEventProperties, trackers: Array<string> = Object.keys(_trackers)) {
  trackConsentAction({ ...consent, eventType: 'allow_all' }, trackers);
}
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 72..77
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 86..88
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 97..102
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 111..113
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 122..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentSelected(
  consent: ConsentEventProperties,
  trackers: Array<string> = Object.keys(_trackers)
) {
  trackConsentAction({ ...consent, eventType: 'allow_selected' }, trackers);
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 61..63
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 86..88
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 97..102
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 111..113
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 122..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentImplicit(
  consent: ConsentEventProperties,
  trackers: Array<string> = Object.keys(_trackers)
) {
  trackConsentAction({ ...consent, eventType: 'implicit_consent' }, trackers);
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 61..63
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 72..77
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 86..88
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 111..113
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 122..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentDeny(consent: ConsentEventProperties, trackers: Array<string> = Object.keys(_trackers)) {
  trackConsentAction({ ...consent, eventType: 'deny_all' }, trackers);
}
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 61..63
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 72..77
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 86..88
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 97..102
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 122..124

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

export function trackConsentExpired(consent: ConsentEventProperties, trackers: Array<string> = Object.keys(_trackers)) {
  trackConsentAction({ ...consent, eventType: 'expired' }, trackers);
}
Severity: Major
Found in plugins/browser-plugin-enhanced-consent/src/api.ts and 5 other locations - About 1 hr to fix
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 61..63
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 72..77
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 86..88
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 97..102
plugins/browser-plugin-enhanced-consent/src/api.ts on lines 111..113

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const DefaultEvents: EventGroup = [
  SnowplowEvent.READY,
  MediaEvent.PAUSE,
  MediaEvent.PLAY,
  MediaEvent.SEEKED,
Severity: Major
Found in plugins/browser-plugin-media-tracking/src/eventGroups.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-youtube-tracking/src/eventGroups.ts on lines 12..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const DefaultEvents: EventGroup = [
  YTEvent.READY,
  YTState.PAUSED,
  YTState.PLAYING,
  YTState.ENDED,
Severity: Major
Found in plugins/browser-plugin-youtube-tracking/src/eventGroups.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-media-tracking/src/eventGroups.ts on lines 14..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export {
  trackMediaAdBreakEnd,
  trackMediaAdBreakStart,
  trackMediaAdClick,
  trackMediaAdComplete,
Severity: Major
Found in plugins/browser-plugin-vimeo-tracking/src/index.ts and 1 other location - About 1 hr to fix
trackers/browser-tracker/src/index.ts on lines 81..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export {
  BrowserTracker,
  TrackerConfiguration,
  CookieSameSite,
  Platform,
Severity: Major
Found in trackers/browser-tracker/src/index.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-vimeo-tracking/src/index.ts on lines 4..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function setUserId(userId?: string | null, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setUserId(userId);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 1 other location - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 272..276

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 59.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function setOptOutCookie(name?: string | null, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setOptOutCookie(name);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 1 other location - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 284..288

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 59.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

export function flushBuffer(configuration?: FlushBufferConfiguration, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.flushBuffer(configuration);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 4 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 212..216
trackers/browser-tracker/src/api.ts on lines 467..474
trackers/browser-tracker/src/api.ts on lines 482..489
trackers/browser-tracker/src/api.ts on lines 496..500

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

export function clearUserData(configuration?: ClearUserDataConfiguration, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.clearUserData(configuration);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 4 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 212..216
trackers/browser-tracker/src/api.ts on lines 360..364
trackers/browser-tracker/src/api.ts on lines 467..474
trackers/browser-tracker/src/api.ts on lines 482..489

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

export function disableAnonymousTracking(
  configuration?: DisableAnonymousTrackingConfiguration,
  trackers?: Array<string>
) {
  dispatchToTrackers(trackers, (t) => {
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 4 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 212..216
trackers/browser-tracker/src/api.ts on lines 360..364
trackers/browser-tracker/src/api.ts on lines 482..489
trackers/browser-tracker/src/api.ts on lines 496..500

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

export function enableActivityTracking(configuration: ActivityTrackingConfiguration, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.enableActivityTracking(configuration);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 4 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 360..364
trackers/browser-tracker/src/api.ts on lines 467..474
trackers/browser-tracker/src/api.ts on lines 482..489
trackers/browser-tracker/src/api.ts on lines 496..500

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

export function enableAnonymousTracking(
  configuration?: EnableAnonymousTrackingConfiguration,
  trackers?: Array<string>
) {
  dispatchToTrackers(trackers, (t) => {
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 4 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 212..216
trackers/browser-tracker/src/api.ts on lines 360..364
trackers/browser-tracker/src/api.ts on lines 467..474
trackers/browser-tracker/src/api.ts on lines 496..500

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export interface MediaAdBreak extends Record<string, unknown> {
  /** Ad break name (e.g., pre-roll, mid-roll, and post-roll) */
  name?: string;
  /** An identifier for the ad break */
  breakId: string;
Severity: Major
Found in plugins/browser-plugin-media/src/types.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-media/src/types.ts on lines 392..408

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export interface MediaPlayerAdBreakUpdate {
  /** Ad break name (e.g., pre-roll, mid-roll, and post-roll) */
  name?: string;
  /** An identifier for the ad break */
  breakId: string;
Severity: Major
Found in plugins/browser-plugin-media/src/types.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-media/src/types.ts on lines 373..389

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export function LinkClickTrackingPlugin(): BrowserPlugin {
  return {
    activateBrowserPlugin: (tracker: BrowserTracker) => {
      _trackers[tracker.id] = tracker;
    },
Severity: Major
Found in plugins/browser-plugin-link-click-tracking/src/index.ts and 2 other locations - About 1 hr to fix
plugins/browser-plugin-button-click-tracking/src/api.ts on lines 20..26
plugins/browser-plugin-form-tracking/src/index.ts on lines 11..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language