Showing 23 of 45 total issues
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,
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,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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.
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;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function TraceResult
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
TrackerEvent.TraceResult = function() {
this.parent = null;
this.Score = null;
this.Success = null;
Function Geolocation
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
TrackerPlugins.Geolocation = function() {
this.interfaces = {
Places:
function(tracker) {
Function Geolocation
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
TrackerPlugins.Geolocation = function() {
this.interfaces = {
Places:
function(tracker) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Connect
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.Connect = function(callback) {
this.generateURL();
var tracker = this;
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 = '';
Function TrackerEvent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function TrackerEvent (tracker) {
this.tracker = tracker;
this.TimeStamp = Date.now();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function TrackerEvent
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TrackerEvent (tracker) {
this.tracker = tracker;
this.TimeStamp = Date.now();
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) {
Function Places
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function(tracker) {
this.tracker = tracker;
this.PlaceType = {
Building: 0,
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) {
Function ProcessTraces
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.ProcessTraces = function(traces, format) {
var data = '';
var item;
var sb = [];
Function Completable
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Completable = function(tracker) {
this.tracker = tracker;
this.CompletableType = {
Function Completable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var Completable = function(tracker) {
this.tracker = tracker;
this.CompletableType = {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function 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) {
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') {
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') {