snowplow/snowplow-javascript-tracker

View on GitHub

Showing 199 of 352 total issues

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

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

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

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

    while (conf.progress!.boundaryTimeoutIds.length) {
      clearTimeout(conf.progress!.boundaryTimeoutIds.pop() as ReturnType<typeof setTimeout>);
    }
Severity: Major
Found in plugins/browser-plugin-media-tracking/src/index.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-media-tracking/src/index.ts on lines 92..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 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

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

export function FormTrackingPlugin(): BrowserPlugin {
  return {
    activateBrowserPlugin: (tracker: BrowserTracker) => {
      _trackers[tracker.id] = tracker;
    },
Severity: Major
Found in plugins/browser-plugin-form-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-link-click-tracking/src/index.ts on lines 70..76

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

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

        while (conf.progress!.boundaryTimeoutIds.length) {
          clearTimeout(conf.progress!.boundaryTimeoutIds.pop() as ReturnType<typeof setTimeout>);
        }
Severity: Major
Found in plugins/browser-plugin-media-tracking/src/index.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-media-tracking/src/index.ts on lines 205..207

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

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

export function trackGA4AddShippingInfo(ecommerce: GA4EcommerceObject, opts: { step: number }) {
  trackCheckoutStep({ step: opts.step, delivery_method: ecommerce.shipping_tier });
}
Severity: Major
Found in plugins/browser-plugin-snowplow-ecommerce/src/ga4/api.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-snowplow-ecommerce/src/ga4/api.ts on lines 79..81

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

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

export function trackGA4AddPaymentOptions(ecommerce: GA4EcommerceObject, opts: { step: number }) {
  trackCheckoutStep({ step: opts.step, payment_method: ecommerce.payment_type });
}
Severity: Major
Found in plugins/browser-plugin-snowplow-ecommerce/src/ga4/api.ts and 1 other location - About 1 hr to fix
plugins/browser-plugin-snowplow-ecommerce/src/ga4/api.ts on lines 75..77

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

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

export function setUserIdFromLocation(querystringField: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setUserIdFromLocation(querystringField);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setUserIdFromCookie(cookieName: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setUserIdFromCookie(cookieName);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setUserIdFromReferrer(querystringField: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setUserIdFromReferrer(querystringField);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setDocumentTitle(title: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setDocumentTitle(title);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setCustomUrl(url: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setCustomUrl(url);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setCollectorUrl(collectorUrl: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setCollectorUrl(collectorUrl);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324

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 56.

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 8 locations. Consider refactoring.
Open

export function setReferrerUrl(url: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setReferrerUrl(url);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 173..177
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 8 locations. Consider refactoring.
Open

export function setCookiePath(path: string, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setCookiePath(path);
  });
}
Severity: Major
Found in trackers/browser-tracker/src/api.ts and 7 other locations - About 1 hr to fix
trackers/browser-tracker/src/api.ts on lines 113..117
trackers/browser-tracker/src/api.ts on lines 125..129
trackers/browser-tracker/src/api.ts on lines 137..141
trackers/browser-tracker/src/api.ts on lines 296..300
trackers/browser-tracker/src/api.ts on lines 308..312
trackers/browser-tracker/src/api.ts on lines 320..324
trackers/browser-tracker/src/api.ts on lines 333..337

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 56.

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 discardHashTag(enable: boolean, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.discardHashTag(enable);
  });
}
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 161..165

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 56.

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 setBufferSize(newBufferSize: number, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setBufferSize(newBufferSize);
  });
}
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 185..189

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 56.

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 discardBrace(enable: boolean, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.discardBrace(enable);
  });
}
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 149..153

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 56.

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

      getAnonymousSessionTracking = (config: TrackerConfiguration) => {
        if (typeof config.anonymousTracking === 'boolean') {
          return false;
        }
        return config.anonymousTracking?.withSessionTracking === true ?? false;
Severity: Major
Found in libraries/browser-tracker-core/src/tracker/index.ts and 1 other location - About 1 hr to fix
libraries/browser-tracker-core/src/tracker/index.ts on lines 153..158

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 56.

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

      getAnonymousServerTracking = (config: TrackerConfiguration) => {
        if (typeof config.anonymousTracking === 'boolean') {
          return false;
        }
        return config.anonymousTracking?.withServerAnonymisation === true ?? false;
Severity: Major
Found in libraries/browser-tracker-core/src/tracker/index.ts and 1 other location - About 1 hr to fix
libraries/browser-tracker-core/src/tracker/index.ts on lines 147..152

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 56.

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 setVisitorCookieTimeout(timeout: number, trackers?: Array<string>) {
  dispatchToTrackers(trackers, (t) => {
    t.setVisitorCookieTimeout(timeout);
  });
}
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 347..351

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 56.

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