Showing 50 of 103 total issues
Function _newInst
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_newInst: function($input, o) {
var tp_inst = new Timepicker(),
inlineSettings = {};
for (var attrName in this._defaults) {
Function diffString2
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
function diffString2(o, n) {
o = o.replace(/\s+$/, "");
n = n.replace(/\s+$/, "");
var out = diff(
- 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 send_correction
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.send_correction = function(
group_id,
participant_id,
essay_id,
field_id,
Function show_instructions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.show_instructions = function() {
var timer_started = false;
$(".round").html("Round " + window.round_number);
reset_essay_links();
$(".round").html("Round " + window.round_number);
Method raw_csv
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.raw_csv(responses)
CSV.generate do |csv|
# header row
csv << [
'id',
Function init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function(data, options) {
var s = this;
// don't allow multiple calls
if (s.d.data) {
Function Timepicker
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Timepicker() {
this.regional = []; // Available regional settings, indexed by language code
this.regional[''] = { // Default regional settings
currentText: 'Now',
closeText: 'Done',
Function onShow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onShow: function(dialog) {
var modal = this;
$(".participant").show();
//accept enter
$(".participant input").keyup(function(event) {
Function finished_modal
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.finished_modal = function finished_modal() {
// basically 'callLater' something about these dialogs
setTimeout(function() {
$(".finished").modal({
close: false,
Function bindEvents
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
bindEvents: function() {
var s = this;
// bind the close event to any element with the closeClass class
$("." + s.o.closeClass).bind("click.simplemodal", function(e) {
Function _get_zoom_to
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_get_zoom_to = function () {
var view = _get_viewport(),
to = {},
resize = currentOpts.autoScale,
double_padding = currentOpts.padding * 2,
Function close
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
close: function() {
var s = this;
// prevent close when dialog does not exist
if (!s.d.data) {
Function _finish
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_finish = function () {
if (!$.support.opacity) {
content.get(0).style.removeAttribute('filter');
wrap.get(0).style.removeAttribute('filter');
}
Function state
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
input.state = function() {
/*
Given a span like:
<span class='correctme' rel='correct string'>original string</span>
Function send_correction
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
group_id,
participant_id,
essay_id,
field_id,
original_value,
Method analyzed_available_payments
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def analyzed_available_payments
@analyzed_available_payments ||= {}
Job.all.each do |job|
Payment.all.each do |payment|
if available_payments.present? && available_payments.is_a?(Hash) && available_payments[job]
- 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 show_other_student_actions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.show_other_student_actions = function() {
// stops the timer and shows what other students are up to
// basically overlays a model dialog and we work from there
window.stop_timer();
// make sure whatever is open is now closed
Function score_card_modal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.score_card_modal = function score_card_modal() {
// basically 'callLater' something about these dialogs
setTimeout(function() {
$(".score_card").modal({
close: false,
Function start_timer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.start_timer = function() {
window.stop_timer();
timer = setInterval(function() {
var minutes_to_render =
TIME_LIMIT_IN_MINUTES - parseInt(seconds / 60) - 1;
Function fancybox
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fancybox = function(obj) {
var opts;
if (busy) {
return;