Showing 9,400 of 17,590 total issues
Function is_file_ignored
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def is_file_ignored(opts, fname):
'''
If file_ignore_regex or file_ignore_glob were given in config,
compare the given file path against all of them and return True
on the first match.
- 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 clone
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
Function dispatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
Function access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function cleanData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
Function webforms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function webforms() {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
Function style
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Function data
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
Function returner
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def returner(ret):
'''
Send an email with the data
'''
Function state
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def state(name,
tgt,
ssh=False,
tgt_type='glob',
ret='',
Function chassis
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def chassis(name, chassis_name=None, password=None, datacenter=None,
location=None, mode=None, idrac_launch=None, slot_names=None,
blade_power_states=None):
'''
Manage a Dell Chassis.
Function detached
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def detached(name,
rev,
target=None,
remote='origin',
user=None,
Function latest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def latest(name,
rev='HEAD',
target=None,
branch=None,
user=None,
Function bootstrap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def bootstrap(vm_, opts=None):
'''
This is the primary entry point for logging into any system (POSIX or
Windows) to install Salt. It will make the decision on its own as to which
deploy function to call.
Function bootstrap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def bootstrap(directory='.',
config='buildout.cfg',
python=sys.executable,
onlyif=None,
unless=None,
Function create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create(vm_):
r'''
Create a single VM from a data dict.
vm\_
Consider simplifying this complex logical expression. Open
Open
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
Consider simplifying this complex logical expression. Open
Open
if ((policy_rule_json or policy_rule_file) and
(policy_type or mode or display_name or description or metadata or parameters)):
ret['comment'] = 'Policy definitions cannot be passed when "policy_rule_json" or "policy_rule_file" is defined!'
return ret
Consider simplifying this complex logical expression. Open
Open
if info:
if info['state'] == 'running':
ret['comment'] = 'Pool {0} exists and is running'.format(name)
else:
__salt__['virt.pool_start'](name, connection=connection, username=username, password=password)
Consider simplifying this complex logical expression. Open
Open
if restart and not just_updated:
comment = 'Restarting{0}: {1}'.format(
process_type is not None and ' {0}'.format(process_type) or '',
name
)