Showing 1,567 of 3,608 total issues
Function ReminderSettingsModel
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ReminderSettingsModel() {
var self = this;
self.selected_frequency = ko.observable();
self.select_day = ko.observable();
self.whom_to_send_message = ko.observable();
File datasender_actions.js
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
function warnThenDeleteDialogBox(allIds, all_selected, entity_type, action_element) {
var delete_dialog = $("#delete_ds_block");
delete_dialog.data("allIds", allIds);
delete_dialog.data("all_selected", all_selected);
delete_dialog.data("entity_type", entity_type);
Consider simplifying this complex logical expression. Open
Open
if (j - e < h && h < l + e && k - e < n && n < m + e || j - e < h && h < l + e && k - e < o && o < m + e || j - e < g && g < l + e && k - e < n && n < m + e || j - e < g && g < l + e && k - e < o && o < m + e) {
if (f.snapMode != "inner") {
var p = Math.abs(k - o) <= e, q = Math.abs(m - n) <= e, r = Math.abs(j - g) <= e, s = Math.abs(l - h) <= e;
if (p)b.position.top = c._convertPositionTo("relative", {top: k - c.helperProportions.height, left: 0}).top - c.margins.top;
if (q)b.position.top = c._convertPositionTo("relative", {top: m, left: 0}).top - c.margins.top;
File submission_index.py
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import logging
from collections import OrderedDict
from types import NoneType
Function PollOptionsViewModel
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PollOptionsViewModel = function() {
var self = this;
var start_date = new Date();
var end_date;
var END_TIME = "T23:59:00";
Function daterangepicker
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.daterangepicker = function(settings){
var rangeInput = jQuery(this);
//defaults
var options = jQuery.extend({
File import_data.py
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import os
import logging
import re
Function QuestionnaireViewModel
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function QuestionnaireViewModel(){
var self = this;
self.questions = ko.observableArray([]);
self.isEditMode = false;
var questionToBeDeleted = null;
Function Select
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.Autocompleter.Select = function (options, input, select, config) {
var CLASSES = {
ACTIVE: "ac_over"
};
Function _tabify
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}, _tabify: function (b) {
function e(g, f) {
g.css("display", "");
!d.support.opacity && f.opacity && g[0].style.removeAttribute("filter")
}
File admin.py
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import datetime
import logging
from django.contrib.auth.admin import UserAdmin
Function viewModel
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var viewModel = function () {
var self = this;
this.fullName = DW.ko.createValidatableObservable({value: ""});
this.email = DW.ko.createValidatableObservable({value: ""});
this.title = DW.ko.createValidatableObservable({value: ""});
Function utils
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
Open
ko.validation.utils = (function () {
var seedId = new Date().getTime();
var domData = {}; //hash of data objects that we reference from dom elements
var domDataKey = '__ko_validation__';
- 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 reminder_settings
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
Open
def reminder_settings(request, project_id):
dbm = get_database_manager(request.user)
questionnaire = Project.get(dbm, project_id)
dashboard_page = settings.HOME_PAGE + "?deleted=true"
if questionnaire.is_void():
- 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 gsm0338.py
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
""" Python Character Mapping Codec based on gsm0338 generated from './GSM0338.TXT' with gencodec.py.
With extra sauce to deal with the 'multibyte' extensions!
Function _fnScrollDraw
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnScrollDraw ( settings )
{
// Given that this is such a monster function, a lot of variables are use
// to try and keep the minimised size as small as possible
var
File jquery.sprintf.js
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery sprintf - perl based functionallity for sprintf and friends.
*
* Copyright © 2008 Carl Fürstenberg
*
File xform_submission_exporter.py
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from collections import OrderedDict
import json
import os
from tempfile import TemporaryFile, mkdtemp
import tempfile
Function viewModel
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var viewModel = function () {
var self = this;
this.fullName = DW.ko.createValidatableObservable({value: ""});
this.email = DW.ko.createValidatableObservable({value: ""});
this.title = DW.ko.createValidatableObservable({value: ""});
Function equiv
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
QUnit.equiv = (function() {
// Call the o related callback with the given arguments.
function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );