fatiando/rockhound

View on GitHub

Showing 75 of 75 total issues

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

    tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)])
Severity: Minor
Found in rockhound/_version.py and 1 other location - About 45 mins to fix
versioneer.py on lines 996..996

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

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

Function run_command has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None):
Severity: Minor
Found in rockhound/_version.py - About 45 mins to fix

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

        tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
    Severity: Minor
    Found in versioneer.py and 1 other location - About 45 mins to fix
    rockhound/_version.py on lines 194..194

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

    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 date is not None:
            # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
            # datestamp. However we prefer "%ci" (which expands to an "ISO-8601
            # -like" string, which we must then edit to make compliant), because
            # it's been around since git-1.5.3, and it's too difficult to
    Severity: Minor
    Found in rockhound/_version.py and 1 other location - About 45 mins to fix
    versioneer.py on lines 979..986

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

    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

    Function run_command has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
    Severity: Minor
    Found in versioneer.py - About 45 mins to fix

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

      def fetch_bedmap2(datasets, *, load=True, chunks=1000, **kwargs):
      Severity: Minor
      Found in rockhound/bedmap2.py - About 35 mins to fix

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

            refs = set([r.strip() for r in refnames.strip("()").split(",")])
        Severity: Minor
        Found in rockhound/_version.py and 1 other location - About 35 mins to fix
        versioneer.py on lines 992..992

        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

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

            refs = set([r.strip() for r in refnames.strip("()").split(",")])
        Severity: Minor
        Found in versioneer.py and 1 other location - About 35 mins to fix
        rockhound/_version.py on lines 190..190

        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

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

        def plus_or_dot(pieces):
            """Return a + if we don't already have one, else return a ."""
            if "+" in pieces.get("closest-tag", ""):
                return "."
            return "+"
        Severity: Minor
        Found in rockhound/_version.py and 1 other location - About 30 mins to fix
        versioneer.py on lines 1229..1233

        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

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

        def plus_or_dot(pieces):
            """Return a + if we don't already have one, else return a ."""
            if "+" in pieces.get("closest-tag", ""):
                return "."
            return "+"
        Severity: Minor
        Found in versioneer.py and 1 other location - About 30 mins to fix
        rockhound/_version.py on lines 334..338

        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 {
        Severity: Major
        Found in rockhound/_version.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return {"version": "0+unknown", "full-revisionid": None,
          Severity: Major
          Found in versioneer.py - About 30 mins to fix

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

            def get_versions():
                """Get version information or return default if unable to do so."""
                # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
                # __file__, we can work backwards from there to the root. Some
                # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
            Severity: Minor
            Found in rockhound/_version.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

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

            def get_root():
                """Get the project root directory.
            
                We require that all commands are run from the project root, i.e. the
                directory that contains setup.py, setup.cfg, and versioneer.py .
            Severity: Minor
            Found in versioneer.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

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

            def fetch_bedmap2(datasets, *, load=True, chunks=1000, **kwargs):
                """
                Fetch the Bedmap2 datasets for Antarctica.
            
                Bedmap2 is a suite of gridded products describing surface elevation,
            Severity: Minor
            Found in rockhound/bedmap2.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

            Severity
            Category
            Status
            Source
            Language