KarrLab/datanator

View on GitHub
datanator/elasticsearch_kl/batch_load.py

Summary

Maintainability
F
4 days
Test Coverage
F
37%

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

    def data_from_mongo_protein(self, server, db, username, password, verbose=False,
Severity: Major
Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

        def __init__(self, profile_name=None, credential_path=None,
    Severity: Major
    Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

          def data_from_mongo_kegg_orthology(self, server, db, username, password, verbose=False,
      Severity: Major
      Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

            def data_from_mongo(self, server, db, username, password, verbose=False,
        Severity: Major
        Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

              def data_from_mongo_metabolite(self, server, db, username, password, verbose=False,
          Severity: Major
          Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

                def data_from_mongo_sabiork_rxn_entries(self, server, db, username, password, verbose=False,
            Severity: Major
            Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

                  def data_from_mongo_metabolites_meta(self, server, db, username, password, verbose=False,
              Severity: Major
              Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

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

                    def data_from_mongo_sabiork(self, server, db, username, password, verbose=False,
                Severity: Major
                Found in datanator/elasticsearch_kl/batch_load.py - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      def data_from_mongo_kegg_orthology(self, server, db, username, password, verbose=False,
                                                  readPreference='nearest', authSource='admin',
                                                  query={}, collection_str='kegg_orthology'):
                          ''' Acquire documents from protein collection in datanator
                  
                  
                  Severity: Major
                  Found in datanator/elasticsearch_kl/batch_load.py and 1 other location - About 5 hrs to fix
                  datanator/elasticsearch_kl/batch_load.py on lines 193..220

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 97.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      def data_from_mongo(self, server, db, username, password, verbose=False,
                                                  readPreference='nearest', authSource='admin',
                                                  query={}, collection_str='rna_halflife_new'):
                          ''' Acquire documents from protein collection in datanator
                  
                  
                  Severity: Major
                  Found in datanator/elasticsearch_kl/batch_load.py and 1 other location - About 5 hrs to fix
                  datanator/elasticsearch_kl/batch_load.py on lines 222..250

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 97.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      def data_from_mongo_sabiork(self, server, db, username, password, verbose=False,
                                                  readPreference='nearest', authSource='admin', projection={'_id': 0},
                                                  query={}):
                          ''' Acquire documents from protein collection in datanator
                  
                  
                  Severity: Major
                  Found in datanator/elasticsearch_kl/batch_load.py and 1 other location - About 5 hrs to fix
                  datanator/elasticsearch_kl/batch_load.py on lines 31..58

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 96.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      def data_from_mongo_protein(self, server, db, username, password, verbose=False,
                                                  readPreference='nearest', authSource='admin', projection={'_id': 0},
                                                  query={}):
                          ''' Acquire documents from protein collection in datanator
                  
                  
                  Severity: Major
                  Found in datanator/elasticsearch_kl/batch_load.py and 1 other location - About 5 hrs to fix
                  datanator/elasticsearch_kl/batch_load.py on lines 135..162

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 96.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 6 locations. Consider refactoring.
                  Open

                          super().__init__(profile_name=profile_name, credential_path=credential_path,
                  Severity: Major
                  Found in datanator/elasticsearch_kl/batch_load.py and 5 other locations - About 40 mins to fix
                  datanator/data_source/brenda/reaction.py on lines 13..13
                  datanator/data_source/ec.py on lines 14..14
                  datanator/data_source/gene_ortholog.py on lines 16..16
                  datanator/data_source/rna_halflife/back_fill_gene_name.py on lines 9..9
                  datanator/util/rna_halflife_util.py on lines 15..15

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 34.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status