Showing 157 of 314 total issues

Function main has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    """
    The main entrypoint for the pyffd command.
    """
    try:
Severity: Minor
Found in src/pyff/mdx.py - About 2 days to fix

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 builtins.py has 977 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Package that contains the basic set of pipes - functions that can be used to put together a processing pipeling
for pyFF.
"""

from __future__ import absolute_import, print_function
Severity: Major
Found in src/pyff/builtins.py - About 2 days to fix

    File mdx.py has 737 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    An implementation of draft-lajoie-md-query
    
    .. code-block:: bash
    
    
    Severity: Major
    Found in src/pyff/mdx.py - About 1 day to fix

      Function request has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
      Open

          def request(self, **kwargs):
              """The main request processor. This code implements all rendering of metadata.
              """
              stats['MD Requests'] += 1
      
      
      Severity: Minor
      Found in src/pyff/mdx.py - About 1 day to fix

      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 samlmd.py has 650 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from __future__ import absolute_import, unicode_literals
      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
      Severity: Major
      Found in src/pyff/samlmd.py - About 1 day to fix

        Function search has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
        Open

            def search(self, query=None, path=None, page=None, page_limit=10, 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 page:  When using paged search, the page index
        Severity: Minor
        Found in src/pyff/mdrepo.py - About 1 day to fix

        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:
        Severity: Minor
        Found in src/pyff/samlmd.py - About 7 hrs to fix

        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 48 (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:
        Severity: Minor
        Found in src/pyff/utils.py - About 7 hrs to fix

        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 main has 168 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def main():
            """
            The main entrypoint for the pyffd command.
            """
            try:
        Severity: Major
        Found in src/pyff/mdx.py - About 6 hrs to fix

          Function request has 156 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def request(self, **kwargs):
                  """The main request processor. This code implements all rendering of metadata.
                  """
                  stats['MD Requests'] += 1
          
          
          Severity: Major
          Found in src/pyff/mdx.py - About 6 hrs to fix

            File utils.py has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # coding=utf-8
            from __future__ import print_function, unicode_literals, absolute_import
            
            """
            
            
            Severity: Minor
            Found in src/pyff/utils.py - About 5 hrs to fix

              Function certreport has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              @pipe
              def certreport(req, *opts):
                  """
              Generate a report of the certificates (optionally limited by expiration time or key size) found in the selection.
              
              
              Severity: Minor
              Found in src/pyff/builtins.py - About 4 hrs to fix

              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 122 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.btsListFilter = function(inputEl, opts) {
              
                      'use strict';
                      
                      var self = this,
              Severity: Major
              Found in src/pyff/site/static/js/bootstrap-list-filter.src.js - About 4 hrs to fix

                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.
                Severity: Minor
                Found in src/pyff/locks.py - About 4 hrs to fix

                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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                def main():
                    """
                    The main entrypoint for the pyFF cmdline tool.
                    """
                
                
                Severity: Minor
                Found in src/pyff/md.py - About 3 hrs to fix

                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 update has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                    def update(self, t, tid=None, ts=None, merge_strategy=None):  # TODO: merge ?
                        log.debug("redis store update: %s: %s" % (t, tid))
                        relt = root(t)
                        ne = 0
                        if ts is None:
                Severity: Minor
                Found in src/pyff/store.py - About 3 hrs to fix

                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 25 (exceeds 5 allowed). Consider refactoring.
                Open

                @pipe
                def finalize(req, *opts):
                    """
                Prepares the working document for publication/rendering.
                
                
                Severity: Minor
                Found in src/pyff/builtins.py - About 3 hrs to fix

                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 _lookup has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _lookup(self, key):
                        if key == 'entities' or key is None:
                            return self.entities.values()
                        if '+' in key:
                            key = key.strip('+')
                Severity: Minor
                Found in src/pyff/store.py - About 3 hrs to fix

                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 fetch has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def fetch(self, store=None):
                        info = dict()
                        data = None
                
                        if os.path.isdir(self.url):
                Severity: Minor
                Found in src/pyff/fetch.py - About 3 hrs to fix

                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 acquireRead has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    def acquireRead(self, blocking=True, timeout=None):
                        """Acquire a read lock for the current thread, waiting at most timeout seconds or doing a
                        non-blocking check in case timeout is <= 0.
                
                    * In case timeout is None, the call to acquireRead blocks until the lock request can be serviced.
                Severity: Minor
                Found in src/pyff/locks.py - About 3 hrs to fix

                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

                Severity
                Category
                Status
                Source
                Language