Showing 267 of 327 total issues
Method ical
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
def ical(mode = :personal)
if params[:id].nil? || params[:id].empty?
render :nothing => true
return
end
- 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 TaskEditor
has 296 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.tasks.TaskEditor = (function ($) {
function TaskEditor(options) {
this.options = options;
this.taskId = this.options.taskId;
this.el = this.options.el;
Function get_tz_name
has a Cognitive Complexity of 68 (exceeds 5 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';
- 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 Grid
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.Grid = (function ($) {
var columns = [
{
id: 'read',
File abstract_task.rb
has 551 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_record_extensions'
# this is abstract class for Task and Template
class AbstractTask < ActiveRecord::Base
self.table_name = 'tasks'
Function Grid
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
jobsworth.Grid = (function ($) {
var columns = [
{
id: 'read',
- 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 rss
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def rss
return if params[:id].blank?
headers['Content-Type'] = 'application/rss+xml'
- 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 update
has a Cognitive Complexity of 54 (exceeds 5 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(',')
- 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
Class AbstractTask
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class AbstractTask < ActiveRecord::Base
self.table_name = 'tasks'
OPEN=0
CLOSED=1
File worklog_report.rb
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
class WorklogReport
include ERB::Util
PIVOT = 1
AUDIT = 2
Function Filter
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.Filter = (function ($) {
function Filter() {
this.init();
this.bind();
}
Method render_task_dependants
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def render_task_dependants(t, depth, root_present)
res = ''
@printed_ids ||= []
return if @printed_ids.include? t.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
File tasks_controller.rb
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'csv'
class TasksController < ApplicationController
DEFAULT_TASK_COUNT = 5
DEFAULT_TASK_NAME = 'New Task'
Function Portal
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.Portal = (function () {
var $ = jQuery;
function Portal(options) {
this.options = options;
Function TaskNotificationEditor
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
jobsworth.tasks.TaskNotificationEditor = (function ($) {
function TaskNotificationEditor(options) {
this.options = options;
this.el = this.options.el;
this.initialize();
Method create_csv
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def create_csv
csv_string = ''
if @column_headers
CSV.generate(csv_string, :col_sep => ',') do |csv|
- 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 init_rows_and_columns
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def init_rows_and_columns
@total = 0
@row_totals = {}
@column_totals = {}
@column_headers = {}
- 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
Class User
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :encryptable,
:recoverable, :rememberable, :trackable
Function Filter
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
jobsworth.Filter = (function ($) {
function Filter() {
this.init();
this.bind();
}
- 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 ical
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ical(mode = :personal)
if params[:id].nil? || params[:id].empty?
render :nothing => true
return
end