Showing 182 of 244 total issues
Method index
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@source_view = params['_source_view'] || 'todo'
init_data_for_sidebar unless mobile?
@todos = current_user.todos.includes(Todo::DEFAULT_INCLUDES)
Function setup_behavior
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup_behavior: function() {
/* show the notes of a todo */
$(document).on("click",".show_notes", function () {
$(this).next().toggle("fast");
return false;
Method empty_container_msg_div_id
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def empty_container_msg_div_id(todo = @todo || @successor)
raise Exception.new, "no @todo or @successor set" if !todo
source_view do |page|
page.project {
- 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 get_weekly_date
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def get_weekly_date(previous)
# determine start
if previous == nil
start = self.start_from.nil? ? Time.zone.now : self.start_from
else
- 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 csv_actions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def csv_actions
content_type = 'text/csv'
CSV::Writer.generate(result = "") do |csv|
csv << ["id", "Context", "Project", "Description", "Notes", "Tags",
"Created at", "Due", "Completed at", "User ID", "Show from",
- 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 post
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def post(lines, options = {})
uri = URI.parse(GTD_URI)
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == "https" # enable SSL/TLS
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def update
# TODO: write tests for updating
@recurring_todo.tag_with(params[:edit_recurring_todo_tag_list]) if params[:edit_recurring_todo_tag_list]
@original_item_context_id = @recurring_todo.context_id
@original_item_project_id = @recurring_todo.project_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 login
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def login
@page_title = "TRACKS::Login"
cookies[:preferred_auth] = prefered_auth? unless cookies[:preferred_auth]
case request.method
when 'POST'
- 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 destroy
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def destroy
@source_view = params['_source_view'] || 'todo'
@todo = current_user.todos.find(params['id'])
@original_item_due = @todo.due
@context_id = @todo.context_id
Method update
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
template = ""
params['project'] ||= {}
if params['project']['state']
Method tag
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tag
get_params_for_tag_view
@page_title = t('todos.tagged_page_title', :tag_name => @tag_title)
@source_view = params['_source_view'] || 'tag'
Method index
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@source_view = params['_source_view'] || 'project_list'
if params[:projects_and_actions]
projects_and_actions
else
Method postTodo
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def postTodo(l, options = {})
uri = URI.parse(GTD_URI_TODOS)
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == "https" # enable SSL/TLS
Method empty_container_msg_div_id
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def empty_container_msg_div_id(todo = @todo || @successor)
raise Exception.new, "no @todo or @successor set" if !todo
source_view do |page|
page.project {
Method determine_remaining_in_context_count
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def determine_remaining_in_context_count(context_id = @todo.context_id)
source_view do |from|
from.deferred {
# force reload to todos to get correct count and not a cached one
@remaining_in_context = current_user.contexts.find(context_id).todos.deferred_or_blocked.count
Function setup_behavior
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
setup_behavior: function() {
/* toggle new todo form for single todo */
$('#toggle_action_new').click(function(){
if ($("#todo_multi_add").is(':visible')) { /* hide multi next action form first */
$('#todo_new_action').show();
- 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 new
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def new
@projects = current_user.projects.active
@contexts = current_user.contexts
respond_to do |format|
format.m {
- 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 show_selected_actions_from_chart
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show_selected_actions_from_chart
@page_title = t('stats.action_selection_title')
@count = 99
@source_view = 'stats'
Function setup_autocomplete_for_predecessor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup_autocomplete_for_predecessor: function() {
$('input[name=predecessor_input]:not(.ac_input)')
.bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
if ( event.keyCode === $.ui.keyCode.TAB &&
$( this ).data( "autocomplete" ).menu.active ) {
Function setup_behavior
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup_behavior: function() {
/* toggle new todo form for single todo */
$('#toggle_action_new').click(function(){
if ($("#todo_multi_add").is(':visible')) { /* hide multi next action form first */
$('#todo_new_action').show();