Showing 845 of 1,621 total issues
File __init__.py
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import division
#
# Copyright 2013, Junta de Andalucia
# http://www.juntadeandalucia.es/
#
Function report_printers
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def report_printers(context, request, file_ext):
'''
Generate a report with all the printers and its related computers.
- 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 lazy
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def lazy(func, *resultclasses):
"""
Turns any callable into a lazy evaluated callable. You need to give result
classes or types -- at least one is needed so that the automatic forcing of
the lazy evaluation code is triggered. Results are not memoized; the
- 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 report_storages
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def report_storages(context, request, file_ext):
'''
Generate a report with all the storages and its related users.
- 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 remove_chef_user_data
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def remove_chef_user_data(user, computers, api, policy_fields=None):
'''
Remove computer policies in chef node
'''
settings = get_current_registry().settings
- 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 apply_change_in_inheritance
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def apply_change_in_inheritance(logger, db, action, obj, policy, node, inheritanceTree):
"""Function that looks for the node that received the change (obj) inside the inheritance tree
and performs the change in its policies.
Args:
- 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 tree-views.js
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint browser: true, nomen: true, unparam: true */
/*global App, gettext, GecosUtils */
/*
* Copyright 2013, Junta de Andalucia
Function report_permission
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def report_permission(context, request, file_ext):
'''
Generate a report with all the admin permissions.
Args:
- 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 add_group_to_inheritance_tree
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def add_group_to_inheritance_tree(logger, db, group, inheritanceTree):
"""Function that adds a group to the inheritance tree of an object.
Args:
logger (object): Logger.
- 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 buildFromLayout
has 184 lines of code (exceeds 25 allowed). Consider refactoring. Open
formTree.prototype.buildFromLayout = function (formElement, context) {
var schemaElement = null;
var node = new formNode();
var view = null;
var key = null;
Function _fnScrollDraw
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnScrollDraw ( o )
{
var
nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
Function update_node
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def update_node(self, user, computer, obj, objold, node, action, parent_id, job_ids_by_computer, force_update):
'''
This method update the node with changed or created actions.
Have two different cases:
1 - object type is ou, user, computer or group.
- 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 get
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def get(self):
result = super(ComputerResource, self).get()
node_collection = self.request.db.nodes
if not result.get('node_chef_id', None):
- 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 move_in_inheritance_and_recalculate_policies
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def move_in_inheritance_and_recalculate_policies(logger, db, srcobj, obj):
"""Move an object to another position in the inheritance Tree and recalculate
the policies of the added nodes.
Args:
- 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 1
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var mergeSort, findInsertIndex;
mergeSort = require('mergesort');
findInsertIndex = require('find-insert-index');
Function get_default_data
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def get_default_data(self, dotted_keys):
# Get gecos_ws_mgmt cookbook version
data = None
try:
data = self.api['/organizations/default/cookbooks/gecos_ws_mgmt']
- 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 check_user_data
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def check_user_data(self, user):
if user['type'] != 'user':
raise ValueError('user must be an user')
if ((not 'email' in user or user['email']=='') and
- 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
BaseGecosTestCase
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseGecosTestCase(unittest.TestCase):
def setUp(self):
'''
1. Parser test.ini
Function exports
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (function () {
'use strict';
var walkStrategies;
File server.py
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import division
#
# Copyright 2015, Junta de Andalucia
# http://www.juntadeandalucia.es/
#