ejhigson/dyPolyChord

View on GitHub
dyPolyChord/run_dynamic_ns.py

Summary

Maintainability
B
5 hrs
Test Coverage

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

    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

    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:

    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:

    There are no issues that match your filters.

    Category
    Status