Showing 9,400 of 17,590 total issues
Function get_proc_dir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_proc_dir(cachedir, **kwargs):
'''
Given the cache directory, return the directory that process data is
stored in, creating it if it doesn't exist.
The following optional Keyword Arguments are handled:
- 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 _find_file_meta
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _find_file_meta(metadata, bucket_name, saltenv, path):
'''
Looks for a file's metadata in the S3 bucket cache file
'''
env_meta = metadata[saltenv] if saltenv in metadata 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
Function lock
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def lock(self, back=None, remote=None):
'''
``remote`` can either be a dictionary containing repo configuration
information, or a pattern. If the latter, then remotes for which the URL
matches the pattern will be locked.
- 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 applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
, applyPlacement: function(offset, placement){
var $tip = this.tip()
, width = $tip[0].offsetWidth
, height = $tip[0].offsetHeight
, actualWidth
Function cib_present
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cib_present(name, cibname, scope=None, extra_args=None):
'''
Ensure that a CIB-file with the content of the current live CIB is created
Should be run on one cluster node only
Function render_jinja_tmpl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_jinja_tmpl(tmplstr, context, tmplpath=None):
opts = context['opts']
saltenv = context['saltenv']
loader = None
newline = False
Function _run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _run(cmd,
cwd=None,
stdin=None,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Function create_certificate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_certificate(
path=None, text=False, overwrite=True, ca_server=None, **kwargs):
'''
Create an X509 certificate.
Function query
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def query(action=None,
command=None,
args=None,
method='GET',
location=None,
Function handlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
Function injectElementWithStyles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
body = document.body,
Function h
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function h(a, b) {
function c(a, c) {
if (a) {
if (e(a)) c || (j = function () {
var a = [].slice.call(arguments);
Function promise
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
Function _changes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _changes(name,
uid=None,
gid=None,
groups=None,
optional_groups=None,
Function query
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def query(key, keyid, method='GET', params=None, headers=None,
requesturl=None, return_url=False, bucket=None, service_url=None,
path='', return_bin=False, action=None, local_file=None,
verify_ssl=True, full_headers=False, kms_keyid=None,
location=None, role_arn=None, chunk_size=16384, path_style=False,
Function create_csr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_csr(ca_name,
bits=2048,
CN='localhost',
C='US',
ST='Utah',
Function create_self_signed_cert
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_self_signed_cert(tls_dir='tls',
bits=2048,
days=365,
CN='localhost',
C='US',
Function pkg
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pkg(pkg_path,
pkg_sum,
hash_type,
test=None,
**kwargs):
Function create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(vm_):
'''
Create a single VM from a data dict
'''
try:
Function create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(vm_):
'''
Create a single VM from a data dict
'''
if 'driver' not in vm_: