Showing 836 of 1,675 total issues
Function markup
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
markup = (function () {
// IE does not support gradients with multiple stops, so we need to simulate
// that for the rainbow slider with 8 divs that each have a single gradient
var gradientFix = "";
Function slide
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Function find_collisions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.find_collisions = function(player_data_coords){
var self = this;
var overlapping_region = this.options.overlapping_region;
var colliders_coords = [];
var colliders_data = [];
Function Radar
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.Radar = function (data, options) {
chart.Radar.defaults = {
scaleOverlay: false,
scaleOverride: false,
Method update_selected_attribute_organizations
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update_selected_attribute_organizations
authorize! :manage_organizations, Organization
@organization = Organization.find(params[:organization_id])
@organization_projects = @organization.projects
# Get the Initialization module. It is set in the ApplicationController : @initialization_module = Pemodule.find_by_alias("initialization")
Function design
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function design(graph, node, prop, config, orn) {
var multitree = config.multitree;
var auxp = [ 'x', 'y' ], auxs = [ 'width', 'height' ];
var ind = +(orn == "left" || orn == "right");
var p = auxp[ind], notp = auxp[1 - ind];
Function nodeFx
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nodeFx: function(opt) {
var viz = this.viz,
graph = viz.graph,
animation = this.nodeFxAnimation,
options = $.merge(this.viz.config, {
Function enter
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enter: function (node) {
if (this.busy)
return;
this.busy = true;
Function attachEvents
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attachEvents: function() {
var htmlCanvas = this.canvas.getElement(),
that = this;
htmlCanvas.oncontextmenu = $.lambda(false);
$.addEvents(htmlCanvas, {
Function writeSegments
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
writeSegments = function(segments, paintInfo) {
var current, next;
for (var i = 0; i < segments.length - 1; i++) {
current = current || _cloneArray(segments[i]);
Function on_start_resize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.on_start_resize = function(event, ui) {
this.$resized_widget = ui.$player.closest('.gs-w');
this.resize_coords = this.$resized_widget.coords();
this.resize_wgd = this.resize_coords.grid;
this.resize_initial_width = this.resize_coords.coords.width;
Function toAbsolute
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.toAbsolute = function(base) {
var base = new jscolor.URI(base);
var r = this;
var t = new jscolor.URI;
Function on_stop_drag
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn.on_stop_drag = function(event, ui) {
this.$helper.add(this.$player).add(this.$wrapper)
.removeClass('dragging');
ui.position.left = ui.position.left + this.baseX;
Function redrawPad
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function redrawPad() {
// redraw the pad pointer
switch(modeID) {
case 0: var yComponent = 1; break;
case 1: var yComponent = 2; break;
Function drawLabels
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLabels() {
ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
//X axis line
if(config.xAxisTop || config.xAxisBottom) {
Function drawLabels
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLabels() {
ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
//X axis line
Function drawLabels
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLabels() {
ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
//X axis line
if(config.xAxisTop || config.xAxisBottom) {
Function drawLabels
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLabels() {
ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
//X axis labels
Function drawLabels
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLabels() {
ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
//X Labels
if(config.xAxisTop || config.xAxisBottom) {
Method pemodule_input
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
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'
- 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"