Showing 229 of 406 total issues
File Scroller.js
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Scroller
* http://github.com/zynga/scroller
*
* Copyright 2013, Sebastian Werner
File Multi.js
has 524 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
==================================================================================================
Core - JavaScript Foundation
Copyright 2010-2012 Zynga Inc.
Copyright 2012-2014 Sebastian Werner
Function create
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
create : function(config)
{
/*
---------------------------------------------------------------------------
INTRO: IDENTICAL BETWEEN SIMPLE AND MULTI
Function create
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
create : function(config)
{
/*
---------------------------------------------------------------------------
INTRO
Function add
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
add : function(target, type, callback, context, capture)
{
var specialHandler = special[type];
if (specialHandler) {
return specialHandler.add(target, type, callback, context, capture);
Function getData
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
getData : function(form)
{
if (jasy.Env.isSet("debug"))
{
core.Assert.isEqual(arguments.length, 1);
- 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 load
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
load : function(uris, callback, context, nocache, type)
{
if (jasy.Env.isSet("debug"))
{
core.Assert.isType(uris, "Array");
Function detect
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
detect : function(data)
{
return new core.event.Promise(function(resolve, reject) {
var url = "//maps.googleapis.com/maps/api/geocode/json?sensor=true&latlng=";
url += data.latitude + "," + data.longitude;
- 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 Class.js
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
==================================================================================================
Core - JavaScript Foundation
Copyright 2010-2012 Zynga Inc.
Copyright 2012-2014 Sebastian Werner
`` has 34 functions (exceeds 20 allowed). Consider refactoring. Open
{
/**
* {Number} Transforms a position (@pos {Number}) between 0 (start of effect) and 1 (end of effect) into a effect modified one.
*/
easeInQuad: function(pos) {
Function __onLoad
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
__onLoad : function() {
document.body.addEventListener('click', function(event) {
var element = event.target;
- 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 __showContent
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
__showContent: function(data, doToggle) {
if (data.file) {
var content = document.getElementById('content'),
- 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 importData
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
importData : function(obj, values, oldValues, field)
{
// Check existence of data structure
var data = obj[store];
if (!data) {
Function doTouchMove
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
doTouchMove: function(touches, timeStamp, scale) {
// Array-like check is enough here
if (touches.length == null) {
throw new Error("Invalid touch list: " + touches);
Function checkSetter
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
checkSetter : function(obj, config, args)
{
var name = config.name;
if (args.length == 0) {
- 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 JSON.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
==================================================================================================
Core - JavaScript Foundation
Copyright 2010-2012 Zynga Inc.
Copyright 2012-2014 Sebastian Werner
Function lex
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
var lex = function () {
var source = Source, length = source.length, symbol, value, begin, position, sign;
while (Index < length) {
symbol = source.charAt(Index);
if ("\t\r\n ".indexOf(symbol) > -1) {
Function assert
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
assert : function(objectOrClass, iface)
{
if (!objectOrClass) {
throw new Error("Invalid class or object to verify interface with: " + objectOrClass);
}
File Asset.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
==================================================================================================
Core - JavaScript Foundation
Copyright 2010-2012 Zynga Inc.
Copyright 2012-2014 Sebastian Werner
Function getValue
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
getValue : function(item)
{
if (jasy.Env.isSet("debug"))
{
core.Assert.isEqual(arguments.length, 1);
- 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"