NationalGenomicsInfrastructure/ngi_pipeline

View on GitHub
scripts/gt_concordance.py

Summary

Maintainability
F
6 days
Test Coverage

File gt_concordance.py has 475 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import re
Severity: Minor
Found in scripts/gt_concordance.py - About 7 hrs to fix

    Function genotype_project has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    def genotype_project(context, project, force):
        config = context.obj
        if is_config_file_ok():
            output_path = os.path.join(config.get('ANALYSIS_PATH'), project, 'piper_ngi/03_genotype_concordance')
            if not os.path.exists(output_path):
    Severity: Minor
    Found in scripts/gt_concordance.py - About 4 hrs 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 check_concordance has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def check_concordance(sample, vcf_data, gt_data, config):
        project = sample.split('_')[0]
        matches = []
        mismatches = []
        lost = []
    Severity: Minor
    Found in scripts/gt_concordance.py - About 3 hrs 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 parse_xl_files has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_xl_files(context):
        config = context.obj
        if is_xl_config_ok(config):
            files_to_archive = []
            samples_to_update = []
    Severity: Minor
    Found in scripts/gt_concordance.py - About 2 hrs 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 run_genotype_sample has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def run_genotype_sample(context, sample, force=None):
        config = context.obj
        project = sample.split('_')[0]
        output_path = os.path.join(config.get('ANALYSIS_PATH'), project, 'piper_ngi/03_genotype_concordance')
    
    
    Severity: Minor
    Found in scripts/gt_concordance.py - About 2 hrs 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 create_gt_files has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_gt_files(config, xl_file_data, snps_data, xl_file_name):
        processed_samples = []
        for sample_id in xl_file_data:
            project_id = sample_id.split('_')[0]
            # create .gt file for each sample
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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_charon has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def fetch_charon(context, project, threshold, all_samples):
        """
        Will fetch samples of the specified project from Charon and print the concordance
        """
        try:
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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 cli has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def cli(context, config_file_path, config, custom_config=None):
        # check first if config file is specified
        if custom_config is not None:
            log.info('Using custom config file: {}'.format(os.path.abspath(custom_config)))
            if not os.path.exists(custom_config):
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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 parse_xl_file has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_xl_file(config, xl_file):
        genotype_data = {}
        data = pyexcel_xlsx.get_data(xl_file)
        data = data.get('HaploView_ped_0') # sheet name
        # getting list of lists
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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 is_config_file_ok has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def is_config_file_ok(context):
        config = context.obj
        # check that required variables are present in config file
        ANALYSIS_PATH = config.get('ANALYSIS_PATH')
        if ANALYSIS_PATH is None:
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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 genotype_sample has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def genotype_sample(context, sample, force):
        if is_config_file_ok():
            concordance = run_genotype_sample(sample, force)
            if concordance is None:
                log.error('Failed to genotype sample: {}'.format(sample))
    Severity: Minor
    Found in scripts/gt_concordance.py - About 1 hr 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 parse_vcf_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_vcf_file(sample, config):
        project = sample.split('_')[0]
        path = os.path.join(config.get('ANALYSIS_PATH'), project, 'piper_ngi/03_genotype_concordance', '{}.vcf'.format(sample))
        vcf_data = {}
        if os.path.exists(path):
    Severity: Minor
    Found in scripts/gt_concordance.py - About 55 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 is_xl_config_ok has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def is_xl_config_ok(config):
        # checking config
        XL_FILES_PATH = config.get('XL_FILES_PATH')
        if XL_FILES_PATH is None:
            log.error("config file missing XL_FILES_PATH argument")
    Severity: Minor
    Found in scripts/gt_concordance.py - About 55 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 update_gt_status_in_charon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_gt_status_in_charon(sample_id, status, concordance=None):
        project_id = sample_id.split('_')[0]
        try:
            charon_session = CharonSession()
            sample = charon_session.sample_get(project_id, sample_id)
    Severity: Minor
    Found in scripts/gt_concordance.py - About 45 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

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

        matches = sorted(matches, key=lambda x:(int(x[0]) if x[0] != 'X' else x[0], int(x[1])))
    Severity: Major
    Found in scripts/gt_concordance.py and 2 other locations - About 3 hrs to fix
    scripts/gt_concordance.py on lines 417..417
    scripts/gt_concordance.py on lines 418..418

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

    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

        mismatches = sorted(mismatches, key=lambda x:(int(x[0]) if x[0] != 'X' else x[0], int(x[1])))
    Severity: Major
    Found in scripts/gt_concordance.py and 2 other locations - About 3 hrs to fix
    scripts/gt_concordance.py on lines 416..416
    scripts/gt_concordance.py on lines 418..418

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

    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

        lost = sorted(lost, key=lambda x:(int(x[0]) if x[0] != 'X' else x[0], int(x[1])))
    Severity: Major
    Found in scripts/gt_concordance.py and 2 other locations - About 3 hrs to fix
    scripts/gt_concordance.py on lines 416..416
    scripts/gt_concordance.py on lines 417..417

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

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

        if not os.path.exists(XL_FILES_ARCHIVED):
            log.error('Path does not exist! Path: {}'.format(XL_FILES_ARCHIVED))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(INTERVAL_FILE):
            log.error('Interval file does not exist! Path: {}'.format(INTERVAL_FILE))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(SNPS_FILE):
            log.error('SNPS file does not exist! Path: {}'.format(SNPS_FILE))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

            if not os.path.exists(output_path):
                log.error('Path does not exist! {}'.format(output_path))
                exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340

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

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

        if not os.path.exists(XL_FILES_PATH):
            log.error("Path to excel files does not exist! Path: {}".format(XL_FILES_PATH))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(ANALYSIS_PATH):
            log.error('Analysis path does not exist! Path: {}'.format(ANALYSIS_PATH))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(GATK_PATH):
            log.error('GATK file does not exist! Path: {}'.format(GATK_PATH))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(ANALYSIS_PATH):
            log.error('Analysis path does not exist! Path: {}'.format(ANALYSIS_PATH))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(GATK_VAR_FILE):
            log.error('GATK variant file does not exist! Path: {}'.format(GATK_VAR_FILE))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 322..324
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

        if not os.path.exists(GATK_REF_FILE):
            log.error('Reference file does not exist! Path: {}'.format(GATK_REF_FILE))
            exit(1)
    Severity: Major
    Found in scripts/gt_concordance.py and 9 other locations - About 1 hr to fix
    scripts/gt_concordance.py on lines 182..184
    scripts/gt_concordance.py on lines 190..192
    scripts/gt_concordance.py on lines 197..199
    scripts/gt_concordance.py on lines 205..207
    scripts/gt_concordance.py on lines 306..308
    scripts/gt_concordance.py on lines 314..316
    scripts/gt_concordance.py on lines 330..332
    scripts/gt_concordance.py on lines 338..340
    scripts/gt_concordance.py on lines 500..502

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

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

                if error:
                    log.error('Sample has not been updated in Charon: {}'.format(sample))
                    log.error('Error says: {}'.format(error))
    Severity: Major
    Found in scripts/gt_concordance.py and 3 other locations - About 40 mins to fix
    scripts/gt_concordance.py on lines 237..239
    scripts/gt_concordance.py on lines 518..520
    scripts/gt_concordance.py on lines 524..526

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

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

                    if error:
                        log.error('Sample has not been updated in Charon: {}'.format(sample))
                        log.error('Error says: {}'.format(error))
    Severity: Major
    Found in scripts/gt_concordance.py and 3 other locations - About 40 mins to fix
    scripts/gt_concordance.py on lines 237..239
    scripts/gt_concordance.py on lines 242..244
    scripts/gt_concordance.py on lines 518..520

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

    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

    @cli.command()
    @click.argument('sample')
    @click.option('--force', '-f', is_flag=True, default=False, help='If not specified, will keep existing vcf files and use them to check concordance. Otherwise overwrite')
    @click.pass_context
    Severity: Minor
    Found in scripts/gt_concordance.py and 1 other location - About 40 mins to fix
    scripts/gt_concordance.py on lines 492..495

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

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

                    if error:
                        log.error('Sample has not been updated in Charon: {}'.format(sample))
                        log.error('Error says: {}'.format(error))
    Severity: Major
    Found in scripts/gt_concordance.py and 3 other locations - About 40 mins to fix
    scripts/gt_concordance.py on lines 237..239
    scripts/gt_concordance.py on lines 242..244
    scripts/gt_concordance.py on lines 524..526

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

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

                if error:
                    log.error('Sample has not been updated in Charon: {}'.format(sample))
                    log.error('Error says: {}'.format(error))
    Severity: Major
    Found in scripts/gt_concordance.py and 3 other locations - About 40 mins to fix
    scripts/gt_concordance.py on lines 242..244
    scripts/gt_concordance.py on lines 518..520
    scripts/gt_concordance.py on lines 524..526

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

    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

    @cli.command()
    @click.argument('project')
    @click.option('--force', '-f', is_flag=True, default=False, help='If not specified, will keep existing vcf files and use them to check concordance. Otherwise overwrite')
    @click.pass_context
    Severity: Minor
    Found in scripts/gt_concordance.py and 1 other location - About 40 mins to fix
    scripts/gt_concordance.py on lines 227..230

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

    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

    There are no issues that match your filters.

    Category
    Status