Showing 156 of 489 total issues
File builtins.py
has 1192 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
These are the built-in "pipes" - functions that can be used to put together a processing pipeling for pyFF.
"""
import base64
File samlmd.py
has 856 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime
from .utils import parse_xml, check_signature, root, validate_document, xml_error, \
schema, iso2datetime, duration2timedelta, filter_lang, url2host, trunc_str, subdomains, \
has_tag, hash_id, load_callable, rreplace, dumptree, first_text, is_text, unicode_stream, \
Lambda, b2u
Function request
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
def request(self, **kwargs):
"""The main request processor. This code implements all rendering of metadata.
"""
if not self.ready:
- 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 store.py
has 743 lines of code (exceeds 250 allowed). Consider refactoring. Open
import operator
import re
import ipaddr
import six
File utils.py
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""
File mdx.py
has 619 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
An implementation of draft-lajoie-md-query
.. code-block:: bash
Function select
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def select(req, *opts):
"""
Select a set of EntityDescriptor elements as the working document.
:param req: The request
- 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 search
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def search(self, query=None, path=None, entity_filter=None, related=None):
"""
:param query: A string to search for.
:param path: The repository collection (@Name) to search in - None for search in all collections
:param entity_filter: An optional lookup expression used to filter the entries before search is done.
- 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 guess_entity_software
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def guess_entity_software(e):
for elt in chain(e.findall(".//{%s}SingleSignOnService" % NS['md']),
e.findall(".//{%s}AssertionConsumerService" % NS['md'])):
location = elt.get('Location')
if location:
- 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 guess_entity_software
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def guess_entity_software(e):
for elt in chain(e.findall(".//{%s}SingleSignOnService" % NS['md']),
e.findall(".//{%s}AssertionConsumerService" % NS['md'])):
location = elt.get('Location')
if location:
- 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 hex_sha1
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
var hex_sha1 = function () {
var fromCharCode = String.fromCharCode;
/*
* Calculate the SHA1 of a raw string
*/
- 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 parse
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def parse(self, resource, content):
info = dict()
info['Description'] = "eIDAS MetadataServiceList"
t = parse_xml(unicode_stream(content))
t.xinclude()
- 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 parse_options
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def parse_options(program, docs, short_args, long_args):
try:
opts, args = getopt.getopt(sys.argv[1:], short_args, long_args)
except getopt.error as msg:
print(msg)
- 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 process_handler
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def process_handler(request):
_ctypes = {'xml': 'application/xml',
'json': 'application/json'}
def _d(x, do_split=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
Function finalize
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def finalize(req, *opts):
"""
Prepares the working document for publication/rendering.
- 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 btsListFilter
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.btsListFilter = function(inputEl, opts) {
'use strict';
var self = this,
Function certreport
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def certreport(req, *opts):
"""
Generate a report of the certificates (optionally limited by expiration time or key size) found in the selection.
- 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 hex_sha1
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
var hex_sha1 = function () {
var fromCharCode = String.fromCharCode;
/*
* Calculate the SHA1 of a raw string
*/
File api.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
from pyramid.config import Configurator
from pyramid.response import Response
import pyramid.httpexceptions as exc
from .exceptions import ResourceException
from .constants import config
Function acquireWrite
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def acquireWrite(self, timeout=None):
"""Acquire a write lock for the current thread, waiting at most timeout seconds or doing a non-blocking
check in case timeout is <= 0.
* In case the write lock cannot be serviced due to the deadlock condition mentioned above, a ValueError is raised.
- 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"