Showing 327 of 327 total issues
Method search
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def search
@filter = params[:term]
if @filter.blank?
render :nothing => true
return
Class TaskRecord
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class TaskRecord < AbstractTask
has_many :property_values, :through => :task_property_values
scope :from_this_year, lambda { where('created_at > ?', Time.zone.now.beginning_of_year - 1.month) }
scope :open_only, -> { where(:status => 0) }
File user.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'digest/md5'
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :encryptable,
Method update
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.update(task, params, user)
old_tags = task.tags.collect { |t| t.name }.sort.join(', ')
old_deps = task.dependencies.collect { |t| "[#{t.issue_num}] #{t.name}" }.sort.join(', ')
old_owner = task.owners.first
old_users = task.owners.collect { |u| u.id }.sort.join(',')
Method rss
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rss
return if params[:id].blank?
headers['Content-Type'] = 'application/rss+xml'
File task_filter.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
class TaskFilter < ActiveRecord::Base
# column `name` is of type `VARCHAR(255)`.
# Note that MySQL 5.x+ and PostgreSQL both track length of "characters" and not "bytes"
MAXIMUM_NAME_LENGTH = 255
Function TaskPropertyEdit
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.TaskPropertyEdit = (function ($) {
function TaskPropertyEdit(options) {
this.options = options;
this.init();
Function createGrid
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Grid.prototype.createGrid = function (rows) {
var self = this;
var options = {
enableCellNavigation: true,
File task_editor.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
var jobsworth = jobsworth || {};
jobsworth.tasks = jobsworth.tasks || {};
Function bindEvents
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskEditor.prototype.bindEvents = function () {
var self = this;
$(this.taskDetailsEditor.el).on('project:changed', function (e, projectId) {
if (projectId == "") return;
Method build_work_added_or_comment
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.build_work_added_or_comment(task, user, params=nil)
work_log_params=params[:work_log].nil? ? {} : params[:work_log].clone
if (work_log_params and !work_log_params[:duration].blank?) or (params and !params[:comment].blank?)
unless params[:comment].blank?
work_log_params[:body] = params[:comment]
- 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 search
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def search
@filter = params[:term]
if @filter.blank?
render :nothing => true
return
- 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 to_tip
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def to_tip(options = {})
user = options[:user]
utz = user.tz
unless @tip
- 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 tasks_helper.rb
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
module TasksHelper
def render_task_form(show_timer = true)
render partial: 'tasks/form', locals: {show_timer: show_timer}
end
Method to_html
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def to_html
return '' if body.blank?
pres = []
- 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 get_tz_name
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_tz_name() {
var so = -1 * (new Date(Date.UTC(2005, 6, 30, 0, 0, 0, 0))).getTimezoneOffset();
var wo = -1 * (new Date(Date.UTC(2005, 12, 30, 0, 0, 0, 0))).getTimezoneOffset();
if (-660 == so && -660 == wo) return 'Pacific/Midway';
Function Task
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
jobsworth.Task = (function ($) {
function Task(id) {
this.load(id);
}
- 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 burndown_extracted_from_show
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def burndown_extracted_from_show
start, step, interval, range, tick = @widget.calculate_start_step_interval_range_tick(tz)
filter = filter_from_filter_by
@items = []
- 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 EmailAddresses
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.EmailAddresses = (function ($) {
function EmailAddresses(user_id) {
this.user_id = user_id;
this.bindEvents();
File widgets_controller.rb
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
class WidgetsController < ApplicationController
OVERDUE = 0
TODAY = 1
TOMORROW = 2