Showing 836 of 1,675 total issues
Avoid too many return
statements within this function. Open
else return [ midx + (1 * dx) , midy + (-1 * dy) ];
Avoid too many return
statements within this function. Open
return ts.sortText(table, b, a);
Avoid too many return
statements within this function. Open
else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
Avoid too many return
statements within this function. Open
if ( xD > yD ) { return 1; }
Avoid too many return
statements within this function. Open
if (xF > yF) { return 1; }
Avoid too many return
statements within this function. Open
if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
if (xF < yF) { return -1; }
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
redirect_to redirect_apply(edit_project_path(@project, :anchor => session[:anchor]), nil, organization_estimations_path(@project.organization)) and return
Avoid too many return
statements within this method. Open
redirect_to redirect_apply(edit_project_path(@project, :anchor => session[:anchor]), nil, organization_setting_path(@project.organization, anchor: "tabs-estimation-models")) and return
Avoid too many return
statements within this method. Open
redirect_to organization_estimations_path(@current_organization), :flash => {:error => I18n.t(:error_project_checkout_failed)} and return
Method project_estimation_statuses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def project_estimation_statuses(organization=nil)
if new_record? || self.estimation_status.nil? #|| !self.organization.estimation_statuses.include?(self.estimation_status)
# For new record
if organization.nil?
nil
- 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 scrollFunction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function scrollFunction(){
for (var i=0;i<dynamicDisplayList["length"];i++) {
if (isScrolledIntoView(dynamicDisplay[dynamicDisplayList[i]][5]) && dynamicDisplay[dynamicDisplayList[i]][2]==false) {
dynamicDisplay[dynamicDisplayList[i]][1]=true;
switch(dynamicDisplay[dynamicDisplayList[i]][6]){
- 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 fmtChartJS
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function fmtChartJS(config,value,fmt){
//alert(fmt);
if(fmt=="notformatted")
{
- 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 has_new_complement_child?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def has_new_complement_child?
has_new_additional_child = false
if self.has_children? && !self.is_root?
self.children.each do |child|
has_new_additional_child = child.wbs_activity_element.nil? && child.wbs_activity.nil?
- 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_project_history_graph
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_project_history_graph(project)
require 'gratr/import'
require 'gratr/dot'
#ObjectSpace.each_object(Module) do |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_module_project_results_view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_module_project_results_view
if params[:module_project_id]
@module_project = ModuleProject.find(params[:module_project_id])
@project = @module_project.project
@project_organization = @project.organization
- 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"