HumanCellAtlas/ingest-client

View on GitHub
ingest/importer/conversion/metadata_entity.py

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%

MetadataEntity has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class MetadataEntity:

    # TODO enforce definition of concrete and domain types for all MetadataEntity
    # It's only currently done this way to minimise friction with other parts of the system
    def __init__(self, concrete_type=TYPE_UNDEFINED, domain_type=TYPE_UNDEFINED, object_id=None,
Severity: Minor
Found in ingest/importer/conversion/metadata_entity.py - About 2 hrs to fix

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

        def __init__(self, concrete_type=TYPE_UNDEFINED, domain_type=TYPE_UNDEFINED, object_id=None,
    Severity: Major
    Found in ingest/importer/conversion/metadata_entity.py - About 1 hr to fix

      Method "__init__" has 10 parameters, which is greater than the 7 authorized.
      Open

          def __init__(self, concrete_type=TYPE_UNDEFINED, domain_type=TYPE_UNDEFINED, object_id=None,
                       content={}, links={}, external_links={}, linking_details={}, row: IngestRow = None,
                       is_reference=False):

      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

      Noncompliant Code Example

      With a maximum number of 4 parameters:

      def do_something(param1, param2, param3, param4, param5):
          ...
      

      Compliant Solution

      def do_something(param1, param2, param3, param4):
          ...
      

      Line too long (81 > 79 characters)
      Open

              self._linking_details = DataNode(defaults=copy.deepcopy(linking_details))

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (91 > 79 characters)
      Open

          # It's only currently done this way to minimise friction with other parts of the system

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (100 > 79 characters)
      Open

                       content={}, links={}, external_links={}, linking_details={}, row: IngestRow = None,

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (120 > 79 characters)
      Open

              return [{'key': key, 'value': self._content[key]} for key in self._content.keys() if key not in excluded_fields]

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (81 > 79 characters)
      Open

          # TODO enforce definition of concrete and domain types for all MetadataEntity

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (96 > 79 characters)
      Open

          def __init__(self, concrete_type=TYPE_UNDEFINED, domain_type=TYPE_UNDEFINED, object_id=None,

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      There are no issues that match your filters.

      Category
      Status