CAEP-UnB/gestorpsi

View on GitHub

Showing 1,772 of 1,772 total issues

File tiny_mce_src.js has 9335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var tinymce = {
    majorVersion : '3',
    minorVersion : '2.7',
    releaseDate : '2009-09-22',
Severity: Major
Found in gestorpsi/media/js/tiny_mce/tiny_mce_src.js - About 3 wks to fix

File jquery-1.11.1.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.11.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in gestorpsi/media/uikit/js/jquery-1.11.1.js - About 2 wks to fix

Function Sizzle has 1347 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function( window ) {

var i,
    support,
    Expr,
Severity: Major
Found in gestorpsi/media/uikit/js/jquery-1.11.1.js - About 6 days to fix

File uikit.js has 1731 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! UIkit 2.8.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */

(function(core) {

    if (typeof define == "function" && define.amd) { // AMD
Severity: Major
Found in gestorpsi/media/uikit/js/uikit.js - About 4 days to fix

Function ajaxSubmit has 591 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.ajaxSubmit = function(options) {
    /*jshint scripturl:true */

    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
    if (!this.length) {
Severity: Major
Found in gestorpsi/media/js/jquery.form.js - About 2 days to fix

Function flexbox has 546 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.flexbox = function(div, o) {

        // TODO: in straight type-ahead mode (showResults: false), if noMatchingResults, dropdown appears after new match
        // TODO: consider having options.mode (select, which replaces html select; combobox; suggest; others?)
        // TODO: highlightMatches uses the case of whatever you typed in to replace the match string, which can look funny
Severity: Major
Found in gestorpsi/media/js/jquery.flexbox.js - About 2 days to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@permission_required_with_403('schedule.schedule_write')
def occurrence_family_form(request, occurence_id=None, template=None):
    occurrence = get_object_or_404(
        ScheduleOccurrence, pk=occurence_id,
        event__referral__service__organization=request.user.get_profile(
Severity: Major
Found in gestorpsi/schedule/views.py and 1 other location - About 2 days to fix
gestorpsi/schedule/views.py on lines 976..1013

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 287.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@permission_required_with_403('schedule.schedule_write')
def occurrence_employee_form(request, occurence_id=None, template=None):
    occurrence = get_object_or_404(
        ScheduleOccurrence, pk=occurence_id,
        event__referral__service__organization=request.user.get_profile(
Severity: Major
Found in gestorpsi/schedule/views.py and 1 other location - About 2 days to fix
gestorpsi/schedule/views.py on lines 936..973

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 287.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function ColorPicker has 465 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var ColorPicker = function () {
        var
            ids = {},
            inAction,
            charMin = 65,
Severity: Major
Found in gestorpsi/media/js/jquery.colorpicker.js - About 2 days to fix

File views.py has 923 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""
Copyright (C) 2008 GestorPsi

Severity: Major
Found in gestorpsi/client/views.py - About 2 days to fix

File jquery.form.js has 910 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery Form Plugin
 * version: 3.50.0-2014.02.05
 * Requires jQuery v1.5 or later
 * Copyright (c) 2013 M. Alsup
Severity: Major
Found in gestorpsi/media/js/jquery.form.js - About 2 days to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    getAttrib : function(e, at) {
        var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;

        if (ed.settings.inline_styles) {
            switch (at) {
Severity: Major
Found in gestorpsi/media/js/tiny_mce/plugins/advimage/js/image.js and 1 other location - About 2 days to fix
gestorpsi/media/js/tiny_mce/themes/advanced/js/image.js on lines 159..216

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 384.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    getAttrib : function(e, at) {
        var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;

        if (ed.settings.inline_styles) {
            switch (at) {
Severity: Major
Found in gestorpsi/media/js/tiny_mce/themes/advanced/js/image.js and 1 other location - About 2 days to fix
gestorpsi/media/js/tiny_mce/plugins/advimage/js/image.js on lines 183..241

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 384.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

     $('div#edit_form li#add_room a').unbind().click(function() {
          $('div#edit_form #place_form').hide();
          $('div#edit_form .form_room_box').hide();
          $('div#edit_form #fieldset_room_identification').show();
          var total = $("div#edit_form .form_room_box").length + 1;
Severity: Major
Found in gestorpsi/media/js/gestorpsi.forms.js and 1 other location - About 2 days to fix
gestorpsi/media/js/gestorpsi.forms.js on lines 300..330

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 363.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

     $('div#edit_form li#add_room a').unbind().click(function() {
          $('div#edit_form #room_form').hide();
          $('div#edit_form .form_room_box').hide();
          $('div#edit_form #fieldset_room_identification').show();
          var total = $("div#edit_form .form_room_box").length + 1;
Severity: Major
Found in gestorpsi/media/js/gestorpsi.forms.js and 1 other location - About 2 days to fix
gestorpsi/media/js/gestorpsi.forms.js on lines 382..412

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 363.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File views.py has 840 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""
Copyright (C) 2008 GestorPsi

Severity: Major
Found in gestorpsi/schedule/views.py - About 2 days to fix

Function fileUploadIframe has 395 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function fileUploadIframe(a) {
        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
        var deferred = $.Deferred();

        // #341
Severity: Major
Found in gestorpsi/media/js/jquery.form.js - About 1 day to fix

File jquery.ui.i18n.all.js has 783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Arabic Translation for jQuery UI date picker plugin. */
/* Khaled Al Horani -- koko.dw@gmail.com */
/* خالد الحوراني -- koko.dw@gmail.com */
/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
jQuery(function($){
Severity: Major
Found in gestorpsi/media/js/i18n/jquery.ui.i18n.all.js - About 1 day to fix

Function generateCSS has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
Open

function generateCSS() {
    var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;

    ce.style.cssText = "";
Severity: Minor
Found in gestorpsi/media/js/tiny_mce/plugins/style/js/props.js - About 1 day to fix

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 models.py has 774 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""
Copyright (C) 2008 GestorPsi

Severity: Major
Found in gestorpsi/report/models.py - About 1 day to fix
Severity
Category
Status
Source
Language