snowplow/snowplow-javascript-tracker

View on GitHub

Showing 353 of 353 total issues

Function DebuggerPlugin has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function DebuggerPlugin(logLevel: LOG_LEVEL = LOG_LEVEL.debug): BrowserPlugin {
  let LOG: Logger;
  let tracker: BrowserTracker;
  let eventColour: string;

Severity: Minor
Found in plugins/browser-plugin-debugger/src/index.ts - About 1 hr to fix

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 updateDurationStats has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private updateDurationStats(log: Log) {
    // if ad was playing until now and it was a linear ad, don't add the duration stats
    let wasPlayingAd = this.lastAdUpdateAt !== undefined;
    const shouldCountStats = (!wasPlayingAd || !log.linearAd) ?? true;
    if (!shouldCountStats) {
Severity: Minor
Found in plugins/browser-plugin-media/src/sessionStats.ts - About 1 hr to fix

    Function getOptimizelyVisitorContexts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getOptimizelyVisitorContexts() {
        var visitor = getOptimizelyData('visitor');
        if (visitor) {
          var context: Visitor = {};
          context.browser = visitor.browser;
    Severity: Minor
    Found in plugins/browser-plugin-optimizely/src/index.ts - About 1 hr to fix

      Function getInnerFormElements has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getInnerFormElements(trackingMarker: string, elt: HTMLFormElement) {
        var innerElements: Array<ElementDataWrapper> = [];
        Array.prototype.slice.call(innerElementTags).forEach((tagname: 'textarea' | 'input' | 'select') => {
          let trackedChildren = Array.prototype.slice.call(elt.getElementsByTagName(tagname)).filter(function (child) {
            return child.hasOwnProperty(trackingMarker);
      Severity: Minor
      Found in plugins/browser-plugin-form-tracking/src/helpers.ts - About 1 hr to fix

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

        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

        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 154..159

        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

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

        function trackEvent(
          event: SelfDescribingJson<MediaPlayerEvent> & CommonEventProperties,
          trackers: Array<string> = Object.keys(_trackers)
        ): void {
          dispatchToTrackersInCollection(trackers, _trackers, (t) => {
        Severity: Minor
        Found in plugins/browser-plugin-youtube-tracking/src/index.ts and 1 other location - About 55 mins to fix
        plugins/browser-plugin-media-tracking/src/index.ts on lines 191..198

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

        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

        function trackMediaEvent(
          event: SelfDescribingJson<MediaPlayerEvent> & CommonEventProperties,
          trackers: Array<string> = Object.keys(_trackers)
        ): void {
          dispatchToTrackersInCollection(trackers, _trackers, (t) => {
        Severity: Minor
        Found in plugins/browser-plugin-media-tracking/src/index.ts and 1 other location - About 55 mins to fix
        plugins/browser-plugin-youtube-tracking/src/index.ts on lines 60..67

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

        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