Showing 54 of 117 total issues
File jquery-jvectormap.min.js
has 2562 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* jVectorMap version 2.0.4
*
* Copyright 2011-2014, Kirill Lebedev
*
Function setValues
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
setValues: function(values) {
var max = -Number.MAX_VALUE,
min = Number.MAX_VALUE,
val,
cc,
- 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
prototype
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
jvm.Map.prototype = {
transX: 0,
transY: 0,
scale: 1,
baseTransX: 0,
Function bindContainerTouchEvents
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
bindContainerTouchEvents: function(){
var touchStartScale,
touchStartDistance,
map = this,
touchX,
- 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 setFocus
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
setFocus: function(config){
var bbox,
itemBbox,
newBbox,
codes,
- 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 pathSvgToVml
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
jvm.VMLPathElement.pathSvgToVml = function(path) {
var cx = 0, cy = 0, ctrlx, ctrly;
path = path.replace(/(-?\d+)e(-?\d+)/g, '0');
return path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g, function(segment, letter, coords, index){
Function bindContainerTouchEvents
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindContainerTouchEvents: function(){
var touchStartScale,
touchStartDistance,
map = this,
touchX,
Function Map
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
jvm.Map = function(params) {
var map = this,
e;
this.params = jvm.$.extend(true, {}, jvm.Map.defaultParams, params);
Function Map
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
jvm.Map = function(params) {
var map = this,
e;
this.params = jvm.$.extend(true, {}, jvm.Map.defaultParams, params);
- 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 handler
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handler(event) {
var orgEvent = event || window.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
Function bindElementEvents
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindElementEvents: function(){
var map = this,
pageX,
pageY,
mouseMoved;
Function setScale
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
setScale: function(scale, anchorX, anchorY, isCentered, animate) {
var viewportChangeEvent = jvm.$.Event('zoom.jvectormap'),
interval,
that = this,
i = 0,
Function handleTouchEvent
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleTouchEvent = function(e){
var touches = e.originalEvent.touches,
offset,
scale,
transXOld,
Function indexOf
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.indexOf = function (searchElement, fromIndex) {
var k;
// 1. Let O be the result of calling ToObject passing
- 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 createMarkers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
createMarkers: function(markers) {
var i,
marker,
point,
markerConfig,
- 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 render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
jvm.Legend.prototype.render = function(){
var ticks = this.series.scale.getTicks(),
i,
inner = jvm.$('<div/>').addClass('jvectormap-legend-inner'),
tick,
Function setFocus
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
setFocus: function(config){
var bbox,
itemBbox,
newBbox,
codes,
Function setValues
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
setValues: function(values) {
var max = -Number.MAX_VALUE,
min = Number.MAX_VALUE,
val,
cc,
Method run
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
if ($this->jverror == 0) {
$this->config = Json::encode(
[
Function createMarkers
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
createMarkers: function(markers) {
var i,
marker,
point,
markerConfig,