KarrLab/datanator

View on GitHub
datanator/data_source/uniprot_nosql.py

Summary

Maintainability
F
3 days
Test Coverage
F
34%

Function fill_reactions has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def fill_reactions(self, start=0):
        """Fill reactions in which the protein acts as a catalyst.
        
        Args:
            start (:obj:`int`, optional): Starting document in sabio_rk. Defaults to 0.
Severity: Minor
Found in datanator/data_source/uniprot_nosql.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

File uniprot_nosql.py has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'''
    Generates uniprot_swiss (reviewed) NoSQL documents
    load documents into MongoDB collections

:Author: Zhouyang Lian <zhouyang.lian@familian.life>
Severity: Minor
Found in datanator/data_source/uniprot_nosql.py - About 3 hrs to fix

    Function fill_abundance_publication has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def fill_abundance_publication(self, start=0):
            """(https://github.com/KarrLab/datanator/issues/51)
    
            Args:
                start(:obj:`int`, optional): beginning of documents.
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.py - About 1 hr 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 load_abundance_from_pax has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_abundance_from_pax(self):
            '''Load protein abundance data but interating from pax collection.
            '''
            _, _, col_pax = self.con_db('pax')
            query = {}
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.py - About 1 hr 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 load_uniprot has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_uniprot(self, query=False, msg='', species=None):
            """Build dataframe
            
            Args:
                query (:obj:`bool`, optional): Whether download all reviewed entries of perform individual queries. Defaults to False.
    Severity: Minor
    Found in datanator/data_source/uniprot_nosql.py - About 1 hr 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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, MongoDB=None, db=None, max_entries=float('inf'), verbose=False,
    Severity: Major
    Found in datanator/data_source/uniprot_nosql.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                              if i % 100 == 0 and self.verbose:
                                  print("     Adding kinlaw_id {} into uniprot collection.".format(kinlaw_id))
                              self.collection.update_one({'uniprot_id': uniprot_id},
      Severity: Major
      Found in datanator/data_source/uniprot_nosql.py - About 45 mins to fix

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

            def remove_redudant_id(self):
                """Remove redundant entries in uniprot collection.
                Priority:
                    1. Has 'abundances' field
                    1. Has 'ko_name' field
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.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

        Function fill_species_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def fill_species_name(self):
                ncbi_taxon_ids = self.collection.distinct('ncbi_taxonomy_id')
                start = 0
                for i, _id in enumerate(ncbi_taxon_ids[start:]):
                    if i == self.max_entries:
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py - About 25 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

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

            def load_df(self, df):
                df_json = json.loads(df.to_json(orient='records'))
                try:        
                    self.collection.insert(df_json)
                except pymongo.errors.InvalidOperation as e:
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 1 other location - About 2 hrs to fix
        datanator/data_source/brenda/reaction.py on lines 79..84

        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 57.

        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

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

                        if self.verbose and j % 100 == 0 and i % 1 == 0:
                            print('  Loading observation info {} of {} ...'.format(
                                j, len(doc['observation'])))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 1 other location - About 2 hrs to fix
        datanator/data_source/protein_aggregate.py on lines 75..77

        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 56.

        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 3 locations. Consider refactoring.
        Open

                    if self.verbose and i % 1 == 0:
                        print('Loading abundance info {} of {} ...'.format(
                            i + progress, min(count, self.max_entries)))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 2 other locations - About 1 hr to fix
        datanator/data_source/protein_aggregate.py on lines 69..71
        datanator/data_source/protein_aggregate.py on lines 101..103

        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 46.

        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 9 locations. Consider refactoring.
        Open

                    if i% 50 == 0 and self.verbose:
                        print('Adding ancestor information to {} out of {} records.'.format(i + start, count))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 8 other locations - About 1 hr to fix
        datanator/data_source/gene_ortholog.py on lines 162..163
        datanator/data_source/metabolites_meta_collection.py on lines 173..174
        datanator/data_source/sabio_reaction.py on lines 170..171
        datanator/data_source/sabio_reaction.py on lines 198..199
        datanator/data_source/uniprot_nosql.py on lines 147..148
        datanator/data_source/uniprot_nosql.py on lines 234..235
        datanator/data_source/uniprot_nosql.py on lines 269..270
        datanator/data_source/uniprot_nosql.py on lines 304..305

        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 39.

        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 9 locations. Consider refactoring.
        Open

                    if i % 50 == 0 and self.verbose:
                        print("Processing doc {} out of {}...".format(i+start, count))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 8 other locations - About 1 hr to fix
        datanator/data_source/gene_ortholog.py on lines 162..163
        datanator/data_source/metabolites_meta_collection.py on lines 173..174
        datanator/data_source/sabio_reaction.py on lines 170..171
        datanator/data_source/sabio_reaction.py on lines 198..199
        datanator/data_source/uniprot_nosql.py on lines 147..148
        datanator/data_source/uniprot_nosql.py on lines 162..163
        datanator/data_source/uniprot_nosql.py on lines 234..235
        datanator/data_source/uniprot_nosql.py on lines 269..270

        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 39.

        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 9 locations. Consider refactoring.
        Open

                    if i % 50 == 0 and self.verbose:
                        print('Adding ko name to {} out of {} records.'.format(i + start, count))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 8 other locations - About 1 hr to fix
        datanator/data_source/gene_ortholog.py on lines 162..163
        datanator/data_source/metabolites_meta_collection.py on lines 173..174
        datanator/data_source/sabio_reaction.py on lines 170..171
        datanator/data_source/sabio_reaction.py on lines 198..199
        datanator/data_source/uniprot_nosql.py on lines 162..163
        datanator/data_source/uniprot_nosql.py on lines 234..235
        datanator/data_source/uniprot_nosql.py on lines 269..270
        datanator/data_source/uniprot_nosql.py on lines 304..305

        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 39.

        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 9 locations. Consider refactoring.
        Open

                    if i % 100 == 0 and self.verbose:
                        print("Processing reaction {} out of {}...".format(i+start, count))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 8 other locations - About 1 hr to fix
        datanator/data_source/gene_ortholog.py on lines 162..163
        datanator/data_source/metabolites_meta_collection.py on lines 173..174
        datanator/data_source/sabio_reaction.py on lines 170..171
        datanator/data_source/sabio_reaction.py on lines 198..199
        datanator/data_source/uniprot_nosql.py on lines 147..148
        datanator/data_source/uniprot_nosql.py on lines 162..163
        datanator/data_source/uniprot_nosql.py on lines 269..270
        datanator/data_source/uniprot_nosql.py on lines 304..305

        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 39.

        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 9 locations. Consider refactoring.
        Open

                    if i % 20 == 0 and self.verbose:
                        print("Processing doc {} out of {}...".format(i+start, count))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 8 other locations - About 1 hr to fix
        datanator/data_source/gene_ortholog.py on lines 162..163
        datanator/data_source/metabolites_meta_collection.py on lines 173..174
        datanator/data_source/sabio_reaction.py on lines 170..171
        datanator/data_source/sabio_reaction.py on lines 198..199
        datanator/data_source/uniprot_nosql.py on lines 147..148
        datanator/data_source/uniprot_nosql.py on lines 162..163
        datanator/data_source/uniprot_nosql.py on lines 234..235
        datanator/data_source/uniprot_nosql.py on lines 304..305

        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 39.

        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

                super(UniprotNoSQL, self).__init__(MongoDB=MongoDB, db=db, username=username,
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py and 1 other location - About 55 mins to fix
        datanator/data_source/kegg_reaction_class.py on lines 22..22

        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 37.

        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 3 locations. Consider refactoring.
        Open

                    self.collection.update_one({"_id": doc["_id"]},
                                               {"$set": {"species_name": species_name}},
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 2 other locations - About 40 mins to fix
        datanator/data_source/metabolites_meta_collection.py on lines 155..156
        datanator/data_source/metabolites_meta_collection.py on lines 267..268

        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

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

                                self.collection.update_one({'uniprot_id': uniprot_id},
                                                        {'$addToSet': {'sabio_kinlaw_id': kinlaw_id}},
                                                        collation=self.collation, upsert=False)
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py and 1 other location - About 35 mins to fix
        datanator/data_source/rna_halflife/doi_10_1091_mbc_e11_01_0028.py on lines 70..73

        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 33.

        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 3 locations. Consider refactoring.
        Open

                data['entrez_id'] = data['entrez_id'].astype(str).str.replace(';', '')
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py and 2 other locations - About 30 mins to fix
        datanator/data_source/uniprot_nosql.py on lines 88..88
        datanator/data_source/uniprot_nosql.py on lines 95..95

        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 32.

        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 4 locations. Consider refactoring.
        Open

                                if i % 100 == 0 and self.verbose:
                                    print("     Adding kinlaw_id {} into uniprot collection.".format(kinlaw_id))
        Severity: Major
        Found in datanator/data_source/uniprot_nosql.py and 3 other locations - About 30 mins to fix
        datanator/data_source/kegg_org_code.py on lines 153..154
        datanator/data_source/protein_modification/10_1093_nar_gkw1075.py on lines 51..52
        datanator/schema_2/transform.py on lines 42..43

        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 32.

        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 3 locations. Consider refactoring.
        Open

                data['ko_number'] = data['ko_number'].astype(str).str.replace(';', '')
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py and 2 other locations - About 30 mins to fix
        datanator/data_source/uniprot_nosql.py on lines 87..87
        datanator/data_source/uniprot_nosql.py on lines 88..88

        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 32.

        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 3 locations. Consider refactoring.
        Open

                data['kegg_org_gene'] = data['kegg_org_gene'].astype(str).str.replace(';', '')
        Severity: Minor
        Found in datanator/data_source/uniprot_nosql.py and 2 other locations - About 30 mins to fix
        datanator/data_source/uniprot_nosql.py on lines 87..87
        datanator/data_source/uniprot_nosql.py on lines 95..95

        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 32.

        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