Showing 203 of 346 total issues
Function cancelInvoice
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cancelInvoice : function(invoiceId) {
jQuery('#dialog').dialog( 'option',
'buttons',
[
Function keyup_checker
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AbstractChosen.prototype.keyup_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
switch (stroke) {
Function hide
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hide : function (el, css) {
// is modal
if (css) {
if (/pop/i.test(this.settings.animation)) {
var end_css = {
Function build_markup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.build_markup = function() {
slides_container.wrap('<div class="'+settings.container_class+'"></div>');
container = slides_container.parent();
slides_container.addClass(settings.slides_container_class);
Function setDisplayedMonth
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setDisplayedMonth : function(m, y, rerender)
{
if (this.startDate == undefined || this.endDate == undefined) {
return;
}
Function captureInvoice
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
captureInvoice : function(invoiceId) {
jQuery('#dialog').dialog( 'option',
'buttons',
[
{
Function build
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function build(string) {
var openWith = prepare(clicked.openWith);
var placeHolder = prepare(clicked.placeHolder);
var replaceWith = prepare(clicked.replaceWith);
var closeWith = prepare(clicked.closeWith);
Function events
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.clearing', 'ul[data-clearing] li',
Function formToArray
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.formToArray = function(semantic) {
var a = [];
if (this.length == 0) return a;
var form = this[0];
Method update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def update
@order = session_admin_order
@order.ip_address = request.remote_ip
@credit_card ||= ActiveMerchant::Billing::CreditCard.new(cc_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 events
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events: function() {
var self = this;
//combine titles selector from settings for click event binding
var click_title_selectors = [],
Function result_select
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Chosen.prototype.result_select = function(evt) {
var high, high_id, item, position;
if (this.result_highlight) {
high = this.result_highlight;
high_id = high.attr("id");
Function css
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
css : function (dropdown, target) {
var offset_parent = dropdown.offsetParent();
// if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) {
var position = target.offset();
position.top -= offset_parent.offset().top;
Function doSubmit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doSubmit() {
// make sure form attrs are set
var t = $form.attr('target'), a = $form.attr('action');
// update form attrs in IE friendly way
Function ajaxForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.ajaxForm = function(options) {
return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
e.preventDefault();
$(this).ajaxSubmit(options);
}).bind('click.form-plugin', function(e) {
Function refresh_custom_select
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refresh_custom_select: function ($select, force_refresh) {
var self = this;
var maxWidth = 0,
$customSelect = $select.next(),
$options = $select.find('option'),
Function ajaxJSONP
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.ajaxJSONP = function(options){
if (!('type' in options)) return $.ajax(options)
var callbackName = 'jsonp' + (++jsonpID),
script = document.createElement('script'),
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function() {
this.labelContainer = $(this.settings.errorLabelContainer);
this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
this.submitted = {};
Function openAnimation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function openAnimation() {
if (!locked) {
lockModal();
closeOpenModals(modal);
modal.addClass("open");
Function pos_phone
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pos_phone : function (init) {
var tip_height = this.outerHeight(this.settings.$next_tip),
tip_offset = this.settings.$next_tip.offset(),
target_height = this.outerHeight(this.settings.$target),
$nub = $('.joyride-nub', this.settings.$next_tip),