emory-libraries/eulxml

View on GitHub

Showing 192 of 192 total issues

Avoid deeply nested control flow statements.
Open

                        if next.type == 'OPEN_PAREN':
                            # point 2
                            if tok.value in NODE_TYPES:
                                tok.type = 'NODETYPE'
                            else:
Severity: Major
Found in eulxml/xpath/core.py - About 45 mins to fix

    Function xmlobjectform_factory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def xmlobjectform_factory(model, form=XmlObjectForm, fields=None, exclude=None,
                              widgets=None, max_num=None, label=None, can_delete=True,
                              extra=None, can_order=False):
        """Dynamically generate a new :class:`XmlObjectForm` class using the
        specified :class:`eulxml.xmlmap.XmlObject` class.
    Severity: Minor
    Found in eulxml/forms/xmlobject.py - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                            if schema_obj is None:
                                # if xsd schema is directly defined, use that
                                if 'XSD_SCHEMA' in defined_attrs:
                                    schema_obj = load_xmlobject_from_file(defined_attrs['XSD_SCHEMA'],
                                                                          XsdSchema)
    Severity: Major
    Found in eulxml/xmlmap/core.py - About 45 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, xpath, true, false, *args, **kwargs):
      Severity: Minor
      Found in eulxml/xmlmap/fields.py - About 35 mins to fix

        Function get has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def get(self, xpath, node, context, mapper, xast):
        Severity: Minor
        Found in eulxml/xmlmap/fields.py - About 35 mins to fix

          Function _html_subform_output has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _html_subform_output(self, subform=None, name=None, gen_html=None, content=None,
          Severity: Minor
          Found in eulxml/forms/xmlobject.py - About 35 mins to fix

            Function get has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def get(self, xpath, node, context, mapper, xast):
            Severity: Minor
            Found in eulxml/xmlmap/fields.py - About 35 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
              Severity: Minor
              Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
                Severity: Minor
                Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
                  Severity: Minor
                  Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                    Function delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def delete(self, xpath, xast, node, context, mapper):
                    Severity: Minor
                    Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                      Function delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def delete(self, xpath, xast, node, context, mapper):
                      Severity: Minor
                      Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, xpath, normalize=False, choices=None, *args, **kwargs):
                        Severity: Minor
                        Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, data=None, instance=None, prefix=None, initial={}, **kwargs):
                          Severity: Minor
                          Found in eulxml/forms/xmlobject.py - About 35 mins to fix

                            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(self, xpath, node, context, mapper, xast):
                            Severity: Minor
                            Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(self, xpath, node_class, instantiate_on_get=False, *args, **kwargs):
                              Severity: Minor
                              Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, xpath, normalize=False, choices=None, *args, **kwargs):
                                Severity: Minor
                                Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                                  Function _html_output has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def _html_output(self, normal_row, error_row, row_ender,  help_text_html, errors_on_separate_row):
                                  Severity: Minor
                                  Found in eulxml/forms/xmlobject.py - About 35 mins to fix

                                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
                                    Severity: Minor
                                    Found in eulxml/xmlmap/fields.py - About 35 mins to fix

                                      Function _serialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def _serialize(self):
                                              if self.axis == '@':
                                                  yield '@'
                                              elif self.axis:
                                                  yield self.axis
                                      Severity: Minor
                                      Found in eulxml/xpath/ast.py - About 35 mins 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