Showing 108 of 136 total issues
Function domReady
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var domReady=function(){
var _1=[];
var _2=function(){
if(!arguments.callee.done){
arguments.callee.done=true;
Function _1e
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _1e=function(){
_5=true;
_4=[];
var _1f=[];
var _20=function(){
Function save
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
save: function(key, value, options) {
var attrs, current;
// Handle both `("key", value)` and `({key: value})` -style calls.
if (_.isObject(key) || key == null) {
Function _52
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _52=function(){
var _53=cssHelper.getViewportWidth();
var _54=cssHelper.getViewportHeight();
if(ua.ie){
var el=document.createElement("div");
Method create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create
begin
params[:ip] = request.remote_ip
params[:organization_id] = @campaign.organization_id
params[:password] = SecureRandom.hex
Function set
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set: function(key, value, options) {
var attrs, attr, val;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (_.isObject(key) || key == null) {
Function add
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function(models, options) {
var i, index, length, model, cid, id, cids = {}, ids = {}, dups = [];
options || (options = {});
models = _.isArray(models) ? models.slice() : [models];
Function _c
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _c=function(_d,_e,_f){
if(ua.ie&&!window.XMLHttpRequest){
window.XMLHttpRequest=function(){
return new ActiveXObject("Microsoft.XMLHTTP");
};
Function start
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
Function getTestingChain
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTestingChain() {
var isOptional = false, escaped = false;
var newBlockMarker = false; //indicates wheter the begin/ending of a block should be indicated
return $.map(opts.mask.split(""), function (element, index) {
Function mediaQuery
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},mediaQuery:function(s,mql){
s=s||"";
var not=false,_14;
var exp=[];
var _15=true;
Function domReady
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
var domReady=function(){
var _1=[];
var _2=function(){
if(!arguments.callee.done){
arguments.callee.done=true;
- 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 caret
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function caret(input, begin, end) {
var npt = input.jquery && input.length > 0 ? input[0] : input;
if (typeof begin == 'number') {
end = (typeof end == 'number') ? end : begin;
if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
Function rule
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},rule:function(s,mql){
var o={};
var idx=s.indexOf("{");
var st=s.substring(0,idx);
var ss=st.split(",");
Function mediaQueryList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _13={mediaQueryList:function(s){
var o={};
var idx=s.indexOf("{");
var lt=s.substring(0,idx);
s=s.substring(idx+1,s.length-1);
Function sync
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
options || (options = {});
Function getMaskTemplate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getMaskTemplate() {
var escaped = false, outCount = 0;
if (opts.mask.length == 1 && opts.greedy == false) { opts.placeholder = ""; } //hide placeholder with single non-greedy mask
var singleMask = $.map(opts.mask.split(""), function (element, index) {
var outElem = [];
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(user, request = nil)
can :read, User
can :read, Answer
can :manage, Poke
can :read, Campaign
Function template
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_.template = function(text, data, settings) {
settings = _.defaults(settings || {}, _.templateSettings);
// Compile the template source, taking care to escape characters that
// cannot be included in a string literal and then unescape them in code
Consider simplifying this complex logical expression. Open
Open
if(_43==="absolute"){
return ((min&&_48>=_44)||(max&&_48<_44)||(!min&&!max&&_48===_44));
}else{
return false;
}