KarrLab/obj_tables

View on GitHub

Showing 542 of 542 total issues

Avoid too many return statements within this function.
Open

                return (value, InvalidAttribute(self, ['Number must be a valid time']))
Severity: Major
Found in obj_tables/core.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return (None, InvalidAttribute(self, ['Unable to deserialize an instance of {}'.format(value.__class__.__name__)]))
    Severity: Major
    Found in obj_tables/core.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return (None, InvalidAttribute(self, ['Unable to deserialize an instance of {}'.format(value.__class__.__name__)]))
      Severity: Major
      Found in obj_tables/core.py - About 30 mins to fix

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

            zuckerberg = address_book.Person(name='Mark Zuckerberg',
                                             type=PersonType.family,
                                             company=facebook,
                                             email_address='zuck@fb.com',
                                             phone_number='650-543-4800',
        Severity: Major
        Found in examples/address_book/tutorial.py and 3 other locations - About 30 mins to fix
        examples/address_book/tutorial.py on lines 40..45
        examples/address_book/tutorial.py on lines 46..51
        examples/address_book/tutorial.py on lines 52..57

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

            def serialize(self, value):
                """ Serialize string
        
                Args:
                    value (:obj:`sympy.Expr`): Python representation
        Severity: Minor
        Found in obj_tables/math/symbolic.py and 1 other location - About 30 mins to fix
        obj_tables/math/symbolic.py on lines 109..120

        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

        Avoid too many return statements within this function.
        Open

                        return (date.fromordinal(int_value + date(1900, 1, 1).toordinal() - 1), None)
        Severity: Major
        Found in obj_tables/core.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return (value, InvalidAttribute(self, ['String must be a valid time']))
          Severity: Major
          Found in obj_tables/core.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return (value, InvalidAttribute(self, ['Value must be an instance of `time`']))
            Severity: Major
            Found in obj_tables/core.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                      return False
              Severity: Major
              Found in obj_tables/core.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return (value, InvalidAttribute(self, ['String must be a valid datetime']))
                Severity: Major
                Found in obj_tables/core.py - About 30 mins to fix

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

                      def serialize(self, value):
                          """ Serialize string
                  
                          Args:
                              value (:obj:`sympy.Basic`): Python representation
                  Severity: Minor
                  Found in obj_tables/math/symbolic.py and 1 other location - About 30 mins to fix
                  obj_tables/math/symbolic.py on lines 176..187

                  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 isinstance(self.species, core.Model):
                              species = self.species.serialize()
                          else:
                              species = self.species
                  Severity: Major
                  Found in obj_tables/chem/core.py and 3 other locations - About 30 mins to fix
                  obj_tables/chem/core.py on lines 813..816
                  obj_tables/chem/core.py on lines 840..843
                  obj_tables/chem/core.py on lines 848..851

                  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 isinstance(self.compartment, core.Model):
                              compartment = self.compartment.serialize()
                          else:
                              compartment = self.compartment
                  Severity: Major
                  Found in obj_tables/chem/core.py and 3 other locations - About 30 mins to fix
                  obj_tables/chem/core.py on lines 808..811
                  obj_tables/chem/core.py on lines 840..843
                  obj_tables/chem/core.py on lines 848..851

                  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

                  Avoid too many return statements within this function.
                  Open

                          return True
                  Severity: Major
                  Found in obj_tables/core.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return (None, InvalidAttribute(self, ['Multiple matching objects with primary attribute = {}'.format(value)]))
                    Severity: Major
                    Found in obj_tables/core.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return (datetime.combine(date_value, time_value), None)
                      Severity: Major
                      Found in obj_tables/core.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return True
                        Severity: Major
                        Found in obj_tables/core.py - About 30 mins to fix

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

                              cook = address_book.Person(name='Tim Cook',
                                                         type=PersonType.business,
                                                         company=apple,
                                                         email_address='tcook@apple.com',
                                                         phone_number='408-996-1010',
                          Severity: Major
                          Found in examples/address_book/tutorial.py and 3 other locations - About 30 mins to fix
                          examples/address_book/tutorial.py on lines 46..51
                          examples/address_book/tutorial.py on lines 52..57
                          examples/address_book/tutorial.py on lines 58..63

                          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

                              pichai = address_book.Person(name='Sundar Pichai',
                                                           type=PersonType.business,
                                                           company=google,
                                                           email_address='sundar@google.com',
                                                           phone_number='650-253-0000',
                          Severity: Major
                          Found in examples/address_book/tutorial.py and 3 other locations - About 30 mins to fix
                          examples/address_book/tutorial.py on lines 40..45
                          examples/address_book/tutorial.py on lines 46..51
                          examples/address_book/tutorial.py on lines 58..63

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

                                          has_tsv = has_tsv or os.path.splitext(f.filename)[1] == '.tsv'
                          Severity: Minor
                          Found in obj_tables/web_service.py and 1 other location - About 30 mins to fix
                          obj_tables/web_service.py on lines 577..577

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language