Showing 56 of 138 total issues
File bootstrap-datepicker.js
has 1622 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Datepicker for Bootstrap v1.5.0-dev (https://github.com/eternicode/bootstrap-datepicker)
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
File dropzone.js
has 1560 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
*
* More info at [www.dropzonejs.com](http://www.dropzonejs.com)
*
File bootstrap.js
has 1311 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ===================================================
* bootstrap-transition.js v2.2.2
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
File bootstrap-timepicker.js
has 686 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* =========================================================
* bootstrap-timepicker.js
* http://www.github.com/jdewit/bootstrap-timepicker
* =========================================================
* Copyright 2012
Function init
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropzone.prototype.init = function() {
var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
if (this.element.tagName === "form") {
this.element.setAttribute("enctype", "multipart/form-data");
}
Function uploadFiles
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropzone.prototype.uploadFiles = function(files) {
var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, method, option, progressObj, response, updateProgress, url, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
xhr = new XMLHttpRequest();
for (_i = 0, _len = files.length; _i < _len; _i++) {
file = files[_i];
Function fill
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fill: function(){
var d = new Date(this.viewDate),
year = d.getUTCFullYear(),
month = d.getUTCMonth(),
startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
Function keydown
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function(e){
if (!this.picker.is(':visible')){
if (e.keyCode === 40 || e.keyCode === 27) // allow down to re-show picker
this.show();
return;
Function _process_options
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_process_options: function(opts){
// Store raw options for reference
this._o = $.extend({}, this._o, opts);
// Processed options
var o = this.o = $.extend({}, this._o);
Function parseDate
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseDate: function(date, format, language){
if (!date)
return undefined;
if (date instanceof Date)
return date;
Function click
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
click: function(e){
e.preventDefault();
var target = $(e.target).closest('span, td, th'),
year, month, day;
if (target.length === 1){
Function getTemplate
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, getTemplate: function() {
if (this.options.templates[this.options.template]) {
return this.options.templates[this.options.template];
}
if (this.showInputs) {
Function elementKeypress
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, elementKeypress: function(e) {
var input = this.$element.get(0);
switch (e.keyCode) {
case 0: //input
break;
Function _buildEvents
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_buildEvents: function(){
var events = {
keyup: $.proxy(function(e){
if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
this.update();
Class AdminpanelFormBuilder
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AdminpanelFormBuilder < ActionView::Helpers::FormBuilder
include ApplicationHelper
alias_method :text_field_original, :text_field
alias_method :radio_button_original, :radio_button
alias_method :text_area_original, :text_area
Function place
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
place: function(){
if (this.isInline)
return this;
var calendarWidth = this.picker.outerWidth(),
calendarHeight = this.picker.outerHeight(),
Function widgetKeypress
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, widgetKeypress: function(e) {
var input = $(e.target).closest('input').attr('name');
switch (e.keyCode) {
case 9: //tab
Function fnUpdate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
"fnUpdate": function ( oSettings, fnDraw ) {
var iListLength = 5;
var oPaging = oSettings.oInstance.fnPagingInfo();
var an = oSettings.aanFeatures.p;
var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
- 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
Method google
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def google
authorize! :read, Adminpanel::Analytic
unless Adminpanel.analytics_profile_id.nil? || Adminpanel.analytics_key_filename.nil? || Adminpanel.analytics_account_email.nil?
service_account_email = Adminpanel.analytics_account_email # Email of service account
Function Dropzone
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Dropzone(element, options) {
var elementOptions, fallback, _ref;
this.element = element;
this.version = Dropzone.version;
this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");