Showing 267 of 327 total issues
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
Function bindEvents
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Portal.prototype.bindEvents = function () {
var self = this;
// sortable
$("#widget-container").find(".column").sortable({
Function initialize
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskEditor.prototype.initialize = function () {
var detailContainer = $("#task_details", $(this.el))[0];
this.taskDetailsEditor = new jobsworth.tasks.TaskDetailsEditor({taskId: this.taskId, el: detailContainer});
var notificationContainer = $("#task_notify", $(this.el))[0];
Function snooze_effects
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
TaskEditor.prototype.snooze_effects = function () {
function formatDate(d) {
return d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
}
Function bind
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bind() {
var $ = jQuery;
var self = this;
// buttons
Function bind
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Grid.prototype.bind = function () {
var self = this;
$("#groupBy select").change(function () {
var value = $(this).val();
Method search_conditions_for
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.search_conditions_for(strings, fields = [:name], options = {})
search_by_id = options.has_key?(:search_by_id) ? options[:search_by_id] : true
id_field= options.has_key?(:table) ? "#{options[:table]}.id" : 'id'
conds = []
- 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"