Showing 836 of 1,675 total issues
Method column_value
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def column_value(column, project, value)
case column.name
when :product_name
content_tag('td class="text_field_text_overflow exportable"', project.root_component)
when :title
Function _findControlPoint
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
_findControlPoint = function(midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {
Function dispCrossText
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function dispCrossText(ctx, config, posX, posY, borderX, borderY, overlay, data, animPC) {
Function getNodesToHide
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getNodesToHide(node) {
node = node || this.clickedNode;
if(!this.config.constrained) {
return [];
}
Function computeArcThroughTwoPoints
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function computeArcThroughTwoPoints(p1, p2){
var aDen = (p1.x * p2.y - p1.y * p2.x), bDen = aDen;
var sq1 = p1.squaredNorm(), sq2 = p2.squaredNorm();
// Fall back to a straight line
if (aDen == 0)
Function compute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
compute: function(graph, prop, opt) {
this.initializeLabel(opt);
var label = this.label, style = label.style;
graph.eachNode(function(n) {
var autoWidth = n.getData('autoWidth'),
Function preprocessSum
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
preprocessSum: function(graph) {
var viz = this.viz;
graph.eachNode(function(elem) {
if(!viz.graph.hasNode(elem.id)) {
viz.graph.addNode(elem);
Function draw
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.draw = function(component, currentConnectionPaintStyle) {
var td = _getDimensions();
if (td != null && td.length == 2) {
var cxy = {x:0,y:0};
if (component.pointOnPath) {
Function SvgEndpoint
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SvgEndpoint = window.SvgEndpoint = function(params) {
var self = this,
_super = SvgComponent.apply(this, [ {
cssClass:params["_jsPlumb"].endpointClass,
originalArgs:arguments,
Function get_offset
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn.get_offset = function(e) {
e.preventDefault();
var mouse_actual_pos = this.get_mouse_pos(e);
var diff_x = Math.round(
mouse_actual_pos.left - this.mouse_init_pos.left);
Function buildSelect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildSelect = function(i, updating, onlyavail){
var o, t, arry = [], currentVal;
i = parseInt(i, 10);
t = $ths.filter('[data-column="' + i + '"]:last');
// t.data('placeholder') won't work in jQuery older than 1.4.3
Function CanvasRenderingContext2D_
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CanvasRenderingContext2D_(canvasElement) {
this.m_ = createMatrixIdentity();
this.mStack_ = [];
this.aStack_ = [];
Method create_inactive_user
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_inactive_user
#No authorize required since everyone can ask for new account which will be validated by an Admin
unless (params[:email].blank? || params[:first_name].blank? || params[:last_name].blank? || params[:login_name].blank?)
user = User.where('login_name = ? OR email = ?', params[:login_name], params[:email]).first
Method set_technology_size_type_abacus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_technology_size_type_abacus
authorize! :edit_organizations, Organization
@organization = Organization.find(params[:organization])
@technologies = @organization.organization_technologies
Method pemodule_input
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pemodule_input(level, est_val, module_project, level_estimation_values, pbs_project_element, attribute_type="", read_only_value=false)
est_val_pe_attribute = est_val.pe_attribute
if est_val_pe_attribute.attr_type == 'integer' or est_val_pe_attribute.attr_type == 'float'
Method update_views_and_widgets
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_views_and_widgets(new_prj, old_mp, new_mp)
#For initialization module level
if old_mp.pemodule.alias == Projestimate::Application::INITIALIZATION
#Copy the views and widgets for the new project
new_view = View.create(organization_id: new_prj.organization_id, name: "#{new_prj.to_s} : view for #{new_mp.to_s}", description: "Please rename the view's name and description if needed.")
Method destroy
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def destroy
@project = Project.find(params[:id])
authorize! :delete_project, @project
is_model = @project.is_model
Method customize_admin_setting_value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def customize_admin_setting_value
case key
when 'session_maximum_lifetime'
I18n.t('datetime.distance_in_words.x_days', :count => value.to_i)
when 'session_inactivity_timeout'
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def update
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
resource_updated = update_resource(resource, account_update_params.merge(password_changed: true))
- 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 duplicate_wbs_activity
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def duplicate_wbs_activity
#Update ancestry depth caching
WbsActivityElement.rebuild_depth_cache!
begin
- 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"