e-ucm/js-tracker

View on GitHub
src/js-tracker.js

Summary

Maintainability
F
2 wks
Test Coverage

Function TrackerAsset has 527 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function TrackerAsset() {

    this.settings = {
        host: 'https://rage.e-ucm.es/',
        port: 443,
Severity: Major
Found in src/js-tracker.js - About 2 days to fix

    Function TrackerAsset has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
    Open

    function TrackerAsset() {
    
        this.settings = {
            host: 'https://rage.e-ucm.es/',
            port: 443,
    Severity: Minor
    Found in src/js-tracker.js - About 2 days 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

    File js-tracker.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright 2017 e-UCM, Universidad Complutense de Madrid
     *
     * Licensed under the Apache License, Version 2.0 (the 'License');
     * you may not use this file except in compliance with the License.
    Severity: Major
    Found in src/js-tracker.js - About 2 days to fix

      Function TraceResult has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
      Open

      TrackerEvent.TraceResult = function() {
          this.parent = null;
      
          this.Score = null;
          this.Success = null;
      Severity: Minor
      Found in src/js-tracker.js - About 1 day 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 TraceResult has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      TrackerEvent.TraceResult = function() {
          this.parent = null;
      
          this.Score = null;
          this.Success = null;
      Severity: Major
      Found in src/js-tracker.js - About 3 hrs to fix

        Function Connect has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.Connect = function(callback) {
                this.generateURL();
        
                var tracker = this;
        
        
        Severity: Minor
        Found in src/js-tracker.js - About 1 hr to fix

          Function ToCsv has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.ToCsv = function() {
                  var success = (this.Success !== null) ? ',success,' + this.Success.toString() : '';
                  var completion = (this.Completion !== null) ? ',completion,' + this.Completion.toString() : '';
                  var response = (this.Response) ? ',response,' + this.Response.replaceAll(',', '\\,') : '';
                  var score = '';
          Severity: Minor
          Found in src/js-tracker.js - About 1 hr to fix

            Function TrackerEvent has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            function TrackerEvent (tracker) {
                this.tracker = tracker;
            
                this.TimeStamp = Date.now();
            
            
            Severity: Minor
            Found in src/js-tracker.js - 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 TrackerEvent has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function TrackerEvent (tracker) {
                this.tracker = tracker;
            
                this.TimeStamp = Date.now();
            
            
            Severity: Minor
            Found in src/js-tracker.js - About 1 hr to fix

              Function addPlugin has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.addPlugin = function(plugin) {
                      var key = null;
              
                      for (key in plugin.functions) {
                          if (key in this) {
              Severity: Minor
              Found in src/js-tracker.js - About 1 hr to fix

                Function SendAllTraces has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.SendAllTraces = function(traces, callback) {
                        var tracker = this;
                
                        if (tracker.active) {
                            tracker.SendUnloggedTraces(function(unl_result, unl_error) {
                Severity: Minor
                Found in src/js-tracker.js - About 1 hr to fix

                  Function ProcessTraces has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      this.ProcessTraces = function(traces, format) {
                          var data = '';
                          var item;
                          var sb = [];
                  
                  
                  Severity: Minor
                  Found in src/js-tracker.js - About 1 hr to fix

                    Function Completable has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Completable = function(tracker) {
                    
                        this.tracker = tracker;
                    
                        this.CompletableType = {
                    Severity: Minor
                    Found in src/js-tracker.js - About 1 hr to fix

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

                      var Completable = function(tracker) {
                      
                          this.tracker = tracker;
                      
                          this.CompletableType = {
                      Severity: Minor
                      Found in src/js-tracker.js - 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 SendPendingTraces has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          this.SendPendingTraces = function(callback) {
                              var tracker = this;
                      
                              // Try to send old traces
                              if (tracker.tracesPending.length > 0) {
                      Severity: Minor
                      Found in src/js-tracker.js - About 1 hr to fix

                        Function DoFlush has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.DoFlush = function(callback) {
                                var tracker = this;
                        
                                tracker.CheckStatus(function(res, err) {
                                    if (err && res === 'Not active') {
                        Severity: Minor
                        Found in src/js-tracker.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (ismap(this.Extensions[key])) {
                                                      var smap = '';
                          
                                                      for (var k in this.Extensions[key]) {
                                                          if (typeof this.Extensions[key][k] === 'number') {
                          Severity: Major
                          Found in src/js-tracker.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (error && tracker.queue.length > 0) {
                                                                tracker.tracesPending.push(data);
                                                                callback('Can\'t send Traces', true);
                                                            }else {
                                                                callback('Everything OK', false);
                            Severity: Major
                            Found in src/js-tracker.js - About 45 mins to fix

                              Function HttpRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  this.HttpRequest = function(url, method, headers, body, success, error) {
                              Severity: Minor
                              Found in src/js-tracker.js - About 45 mins to fix

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

                                        for (key in plugin.objects) {
                                            if (typeof TrackerEvent.TraceObject.ObjectIDs[key] !== 'undefined') {
                                                console.log('WARNING: Object ' + key + ' already exists in objects list, ignoring.');
                                                continue;
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 2 other locations - About 2 hrs to fix
                                src/js-tracker.js on lines 590..597
                                src/js-tracker.js on lines 610..617

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

                                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

                                        for (key in plugin.extensions) {
                                            if (typeof TrackerEvent.TraceResult.ExtensionIDs[key] !== 'undefined') {
                                                console.log('WARNING: Extension ' + key + ' already exists in extensions list, ignoring.');
                                                continue;
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 2 other locations - About 2 hrs to fix
                                src/js-tracker.js on lines 590..597
                                src/js-tracker.js on lines 600..607

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

                                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

                                        for (key in plugin.verbs) {
                                            if (typeof TrackerEvent.TraceVerb.VerbIDs[key] !== 'undefined') {
                                                console.log('WARNING: Verb ' + key + ' already exists in verbs list, ignoring.');
                                                continue;
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 2 other locations - About 2 hrs to fix
                                src/js-tracker.js on lines 600..607
                                src/js-tracker.js on lines 610..617

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

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

                                    this.Selected = function(alternativeId, optionId, type) {
                                        if (typeof type === 'undefined') {type = 5;}
                                
                                        this.tracker.setResponse(optionId);
                                        return this.tracker.Trace('selected',this.AlternativeType.properties[type],alternativeId);
                                Severity: Major
                                Found in src/js-tracker.js and 3 other locations - About 2 hrs to fix
                                plugins/geolocation.js on lines 84..90
                                src/js-tracker.js on lines 1015..1020
                                src/js-tracker.js on lines 1046..1051

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

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

                                    this.Unlocked = function(alternativeId, optionId, type) {
                                        if (typeof type === 'undefined') {type = 5;}
                                
                                        this.tracker.setResponse(optionId);
                                        return this.tracker.Trace('unlocked',this.AlternativeType.properties[type],alternativeId);
                                Severity: Major
                                Found in src/js-tracker.js and 3 other locations - About 2 hrs to fix
                                plugins/geolocation.js on lines 84..90
                                src/js-tracker.js on lines 1008..1013
                                src/js-tracker.js on lines 1046..1051

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

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

                                    this.Progressed = function(completableId, type, progress) {
                                        if (typeof type === 'undefined') {type = 8;}
                                
                                        this.tracker.setProgress(progress);
                                        return this.tracker.Trace('progressed',this.CompletableType.properties[type],completableId);
                                Severity: Major
                                Found in src/js-tracker.js and 3 other locations - About 2 hrs to fix
                                plugins/geolocation.js on lines 84..90
                                src/js-tracker.js on lines 1008..1013
                                src/js-tracker.js on lines 1015..1020

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

                                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 (data) {
                                            tracker.settings.userToken = 'Bearer ' + data.user.token;
                                            if (tracker.settings.debug) {
                                                console.info('AuthToken: ' + data.user.token);
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 1 other location - About 2 hrs to fix
                                src/js-tracker.js on lines 98..105

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

                                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 (data) {
                                            tracker.settings.userToken = 'Bearer ' + data.user.token;
                                            if (tracker.settings.debug) {
                                                console.info('AuthToken: ' + data.user.token);
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 1 other location - About 2 hrs to fix
                                src/js-tracker.js on lines 119..126

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

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

                                    this.Initialized = function(completableId, type) {
                                        if (typeof type === 'undefined') {type = 8;}
                                
                                        return this.tracker.Trace('initialized',this.CompletableType.properties[type],completableId);
                                    };
                                Severity: Major
                                Found in src/js-tracker.js and 6 other locations - About 1 hr to fix
                                plugins/geolocation.js on lines 62..66
                                plugins/geolocation.js on lines 68..72
                                src/js-tracker.js on lines 981..985
                                src/js-tracker.js on lines 987..991
                                src/js-tracker.js on lines 1076..1080
                                src/js-tracker.js on lines 1082..1086

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

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

                                    this.Skipped = function(accessibleId, type) {
                                        if (typeof type === 'undefined') {type = 4;}
                                
                                        return this.tracker.Trace('skipped',this.AccessibleType.properties[type],accessibleId);
                                    };
                                Severity: Major
                                Found in src/js-tracker.js and 6 other locations - About 1 hr to fix
                                plugins/geolocation.js on lines 62..66
                                plugins/geolocation.js on lines 68..72
                                src/js-tracker.js on lines 981..985
                                src/js-tracker.js on lines 1040..1044
                                src/js-tracker.js on lines 1076..1080
                                src/js-tracker.js on lines 1082..1086

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

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

                                    this.Interacted = function(gameobjectId, type) {
                                        if (typeof type === 'undefined') {type = 3;}
                                
                                        return this.tracker.Trace('interacted',this.GameObjectType.properties[type],gameobjectId);
                                    };
                                Severity: Major
                                Found in src/js-tracker.js and 6 other locations - About 1 hr to fix
                                plugins/geolocation.js on lines 62..66
                                plugins/geolocation.js on lines 68..72
                                src/js-tracker.js on lines 981..985
                                src/js-tracker.js on lines 987..991
                                src/js-tracker.js on lines 1040..1044
                                src/js-tracker.js on lines 1082..1086

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

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

                                    this.Accessed = function(accessibleId, type) {
                                        if (typeof type === 'undefined') {type = 4;}
                                
                                        return this.tracker.Trace('accessed',this.AccessibleType.properties[type],accessibleId);
                                    };
                                Severity: Major
                                Found in src/js-tracker.js and 6 other locations - About 1 hr to fix
                                plugins/geolocation.js on lines 62..66
                                plugins/geolocation.js on lines 68..72
                                src/js-tracker.js on lines 987..991
                                src/js-tracker.js on lines 1040..1044
                                src/js-tracker.js on lines 1076..1080
                                src/js-tracker.js on lines 1082..1086

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

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

                                    this.Used = function(gameobjectId, type) {
                                        if (typeof type === 'undefined') {type = 3;}
                                
                                        return this.tracker.Trace('used',this.GameObjectType.properties[type],gameobjectId);
                                    };
                                Severity: Major
                                Found in src/js-tracker.js and 6 other locations - About 1 hr to fix
                                plugins/geolocation.js on lines 62..66
                                plugins/geolocation.js on lines 68..72
                                src/js-tracker.js on lines 981..985
                                src/js-tracker.js on lines 987..991
                                src/js-tracker.js on lines 1040..1044
                                src/js-tracker.js on lines 1076..1080

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

                                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

                                        for (key in plugin.functions) {
                                            if (key in this) {
                                                console.log('WARNING: Function ' + key + '() already exists in tracker, ignoring.');
                                                continue;
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 1 other location - About 1 hr to fix
                                src/js-tracker.js on lines 620..627

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

                                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

                                        for (key in plugin.interfaces) {
                                            if (key in this) {
                                                console.log('WARNING: Interface ' + key + ' already exists, ignoring.');
                                                continue;
                                            }
                                Severity: Major
                                Found in src/js-tracker.js and 1 other location - About 1 hr to fix
                                src/js-tracker.js on lines 580..587

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

                                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

                                    this.AlternativeType = {
                                        Question: 0,
                                        Menu: 1,
                                        Dialog: 2,
                                        Path: 3,
                                Severity: Minor
                                Found in src/js-tracker.js and 1 other location - About 55 mins to fix
                                plugins/geolocation.js on lines 31..40

                                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 (data) {
                                            if (tracker.settings.debug && data.responseJSON) {
                                                console.log(data.responseJSON);
                                            }
                                            callback(data, true);
                                Severity: Minor
                                Found in src/js-tracker.js and 1 other location - About 55 mins to fix
                                src/js-tracker.js on lines 106..111

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

                                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 (data) {
                                            if (tracker.settings.debug && data.responseJSON) {
                                                console.log(data.responseJSON);
                                            }
                                            callback(data, true);
                                Severity: Minor
                                Found in src/js-tracker.js and 1 other location - About 55 mins to fix
                                src/js-tracker.js on lines 127..132

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

                                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

                                There are no issues that match your filters.

                                Category
                                Status