ejhigson/nestcheck

View on GitHub

Showing 23 of 27 total issues

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

        imp_rmse, imp_rmse_unc, imp_frac, imp_frac_unc = \
            nestcheck.error_analysis.implementation_std(
                df.loc[('values rmse', 'value')],
                df.loc[('values rmse', 'uncertainty')],
                df.loc[('bootstrap std mean', 'value')],
Severity: Major
Found in nestcheck/diagnostics_tables.py and 1 other location - About 1 hr to fix
nestcheck/diagnostics_tables.py on lines 193..198

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

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

    imp_std, imp_std_unc, imp_frac, imp_frac_unc = \
        nestcheck.error_analysis.implementation_std(
            df.loc[('values std', 'value')],
            df.loc[('values std', 'uncertainty')],
            df.loc[('bootstrap std mean', 'value')],
Severity: Major
Found in nestcheck/diagnostics_tables.py and 1 other location - About 1 hr to fix
nestcheck/diagnostics_tables.py on lines 206..211

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

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

            output['avnlike'] if not isinstance(output['avnlike'], (list, tuple))
            else " ".join([str(x) for x in output['avnlike']]),
Severity: Major
Found in nestcheck/write_polychord_output.py and 2 other locations - About 55 mins to fix
nestcheck/write_polychord_output.py on lines 241..243
nestcheck/write_polychord_output.py on lines 247..249

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

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

        ' nlike:         {0}'.format(
            output['nlike'] if not isinstance(output['nlike'], (list, tuple))
            else " ".join([str(x) for x in output['nlike']])),
Severity: Major
Found in nestcheck/write_polychord_output.py and 2 other locations - About 55 mins to fix
nestcheck/write_polychord_output.py on lines 245..246
nestcheck/write_polychord_output.py on lines 247..249

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

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

            output['avnlikeslice'] if not isinstance(
                output['avnlikeslice'], (list, tuple))
            else " ".join([str(x) for x in output['avnlikeslice']])),
Severity: Major
Found in nestcheck/write_polychord_output.py and 2 other locations - About 55 mins to fix
nestcheck/write_polychord_output.py on lines 241..243
nestcheck/write_polychord_output.py on lines 245..246

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

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

Block comment should start with '# '
Open

            #results.samples_n tells us how many live samples there are at a given iteration,
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Block comment should start with '# '
Open

            #numpy diff goes out[i] = samples[i+1] - samples[i], so it records the 
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Trailing whitespace
Open

            #value. We know we want the last n_live to end with 1      
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Line too long (93 > 79 characters)
Open

            #so use the diff of this to assign the samples[change_in_nlive_at_sample (col 2)]
Severity: Minor
Found in nestcheck/data_processing.py by pep8

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.

Invalid escape sequence '\m'
Open

        :math:`\mu` is the mean sample value.
Severity: Minor
Found in nestcheck/error_analysis.py by pep8

Invalid escape sequences are deprecated in Python 3.6.

Okay: regex = r'\.png$'
W605: regex = '\.png$'

Trailing whitespace
Open

            #numpy diff goes out[i] = samples[i+1] - samples[i], so it records the 
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Trailing whitespace is superfluous.

The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.

Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n    \n    bang = 12

Line too long (82 > 79 characters)
Open

            #numpy diff goes out[i] = samples[i+1] - samples[i], so it records the 
Severity: Minor
Found in nestcheck/data_processing.py by pep8

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

            output['avnlike'] if not isinstance(output['avnlike'], (list, tuple))
Severity: Minor
Found in nestcheck/write_polychord_output.py by pep8

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 (93 > 79 characters)
Open

            #results.samples_n tells us how many live samples there are at a given iteration,
Severity: Minor
Found in nestcheck/data_processing.py by pep8

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.

Block comment should start with '# '
Open

            #value. We know we want the last n_live to end with 1      
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Invalid escape sequence '\m'
Open

        If true, the samples :math:`X` are mapped to :math:`2 \mu - X`, where
Severity: Minor
Found in nestcheck/error_analysis.py by pep8

Invalid escape sequences are deprecated in Python 3.6.

Okay: regex = r'\.png$'
W605: regex = '\.png$'

Line too long (92 > 79 characters)
Open

     author, 'nestcheck', 'Error analysis, diagnostic tests and plots for nested sampling.',
Severity: Minor
Found in docs/conf.py by pep8

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.

Block comment should start with '# '
Open

            #samples added/removed at samples[i]
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

The backslash is redundant between brackets
Open

            ax.get_subplotspec().rowspan.stop == ax.get_gridspec().nrows \
Severity: Minor
Found in nestcheck/plots.py by pep8

Avoid explicit line join between brackets.

The preferred way of wrapping long lines is by using Python's
implied line continuation inside parentheses, brackets and braces.
Long lines can be broken over multiple lines by wrapping expressions
in parentheses.  These should be used in preference to using a
backslash for line continuation.

E502: aaa = [123, \\n       123]
E502: aaa = ("bbb " \\n       "ccc")

Okay: aaa = [123,\n       123]
Okay: aaa = ("bbb "\n       "ccc")
Okay: aaa = "bbb " \\n    "ccc"
Okay: aaa = 123  # \\

Block comment should start with '# '
Open

            #so use the diff of this to assign the samples[change_in_nlive_at_sample (col 2)]
Severity: Minor
Found in nestcheck/data_processing.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment
Severity
Category
Status
Source
Language