ejhigson/dyPolyChord

View on GitHub

Showing 10 of 10 total issues

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

        try:
            # Combine initial and dynamic runs
            run = dyPolyChord.output_processing.process_dypolychord_run(
                settings_dict_in['file_root'], settings_dict_in['base_dir'],
                dynamic_goal=dynamic_goal)
Severity: Major
Found in dyPolyChord/run_dynamic_ns.py and 2 other locations - About 1 hr to fix
dyPolyChord/run_dynamic_ns.py on lines 230..250
dyPolyChord/run_dynamic_ns.py on lines 424..451

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

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

            try:
                # Get settings for dynamic run based on initial run
                dyn_info = process_initial_run(
                    settings_dict_in, nlive_const=nlive_const,
                    smoothing_filter=smoothing_filter,
Severity: Major
Found in dyPolyChord/run_dynamic_ns.py and 2 other locations - About 1 hr to fix
dyPolyChord/run_dynamic_ns.py on lines 264..289
dyPolyChord/run_dynamic_ns.py on lines 424..451

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

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

            try:
                if settings_dict['seed'] >= 0:
                    settings_dict['seed'] += seed_increment
                run_output = nestcheck.data_processing.process_polychord_stats(
                    settings_dict['file_root'], settings_dict['base_dir'])
Severity: Major
Found in dyPolyChord/run_dynamic_ns.py and 2 other locations - About 1 hr to fix
dyPolyChord/run_dynamic_ns.py on lines 230..250
dyPolyChord/run_dynamic_ns.py on lines 264..289

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

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 deeply nested control flow statements.
Open

                    if not files_exist[i]:
                        msg += '\n' + name
                print(msg)
Severity: Major
Found in dyPolyChord/run_dynamic_ns.py - About 45 mins to fix

    At least two spaces before inline comment
    Open

                pass # protect from error reading nlike from .stats file
    Severity: Minor
    Found in dyPolyChord/output_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

    Do not use bare 'except'
    Open

                except:  # pragma: no cover
    Severity: Minor
    Found in dyPolyChord/run_dynamic_ns.py by pep8

    When catching exceptions, mention specific exceptions when possible.

    Okay: except Exception:
    Okay: except BaseException:
    E722: except:

    Line too long (82 > 79 characters)
    Open

                                                                  'python-dateutil']},
    Severity: Minor
    Found in setup.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.

    At least two spaces before inline comment
    Open

                pass # protect from error reading nlike from .stats file
    Severity: Minor
    Found in dyPolyChord/output_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

    Do not use bare 'except'
    Open

            except:  # pragma: no cover
    Severity: Minor
    Found in dyPolyChord/run_dynamic_ns.py by pep8

    When catching exceptions, mention specific exceptions when possible.

    Okay: except Exception:
    Okay: except BaseException:
    E722: except:

    Do not use bare 'except'
    Open

                except:  # pragma: no cover
    Severity: Minor
    Found in dyPolyChord/run_dynamic_ns.py by pep8

    When catching exceptions, mention specific exceptions when possible.

    Okay: except Exception:
    Okay: except BaseException:
    E722: except:
    Severity
    Category
    Status
    Source
    Language