From a6860616e8e2b805f18a19d671ca8aea0ca8f697 Mon Sep 17 00:00:00 2001 From: leonardomilv3 Date: Tue, 9 Jul 2024 22:24:33 -0300 Subject: [PATCH 01/52] fix: sonar version and properties --- .github/workflows/metrics.yml | 2 +- .github/workflows/test.yml | 4 ++-- README.md | 2 +- sonar-project.properties | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 5107a671..3c3d7137 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -25,7 +25,7 @@ jobs: run: | git config --global user.email "${{secrets.USER_EMAIL}}" git config --global user.name "${{secrets.USER_NAME}}" - git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_DOC}}@github.com/fga-eps-mds/2023.2-MeasureSoftGram-DOC" doc + git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_DOC}}@github.com/fga-eps-mds/2024.1-MeasureSoftGram-DOC" doc mkdir -p doc/analytics-raw-data cp -R analytics-raw-data/*.json doc/analytics-raw-data cd doc/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cd48269f..4c5ecca1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,13 +31,13 @@ jobs: run: tox - name: Scanner do SonarCloud - uses: SonarSource/sonarcloud-github-action@v1.8 + uses: SonarSource/sonarcloud-github-action@v2.3.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Envia cobertura para o Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} directory: ./ diff --git a/README.md b/README.md index f128d3ff..78b7343b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 2023-2 MeasureSoftGram-CLI +# 2024-1 MeasureSoftGram-CLI ## Badges diff --git a/sonar-project.properties b/sonar-project.properties index f313c8cf..5f04bd42 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -sonar.projectKey=fga-eps-mds_2023-2-MeasureSoftGram-CLI +sonar.projectKey=fga-eps-mds_2024.1-MeasureSoftGram-CLI sonar.organization=fga-eps-mds-1 sonar.python.version=3 From de428406e4d759d9b679469ee65c5e7e3a4d3d25 Mon Sep 17 00:00:00 2001 From: Adne Moretti <64036847+AdneMoretti@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:01:08 -0300 Subject: [PATCH 02/52] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78b7343b..ada37c1d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # 2024-1 MeasureSoftGram-CLI - +Command line project to MeasureSoftGram ## Badges [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2023-1-MeasureSoftGram-CLI&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=fga-eps-mds_2023-1-MeasureSoftGram-CLI) From 037e30caed6c19e8faee8db59db379f5a7dd3312 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Sat, 27 Jul 2024 16:19:53 -0300 Subject: [PATCH 03/52] Feat: add norm diff command --- src/cli/commands/cmd_norm_diff.py | 91 +++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/cli/commands/cmd_norm_diff.py diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py new file mode 100644 index 00000000..086b750f --- /dev/null +++ b/src/cli/commands/cmd_norm_diff.py @@ -0,0 +1,91 @@ +import logging +from core.transformations import norm_diff +from src.cli.jsonReader import open_json_file +from src.cli.utils import print_error, print_info, print_rule +from src.cli.exceptions import exceptions +import numpy as np + +logger = logging.getLogger("msgram") + +def read_json_file(file_path, sort_key=None): + try: + json_data = open_json_file(file_path) + return sorted(json_data, key=lambda x: x[sort_key]) if sort_key else json_data + except exceptions.MeasureSoftGramCLIException as e: + print_error(f"[red]Error reading file {file_path}: {e}\n") + print_rule() + exit(1) + +def read_calculated_file(extracted_calculation): + try: + calculated_data = [] + json = open_json_file(extracted_calculation) + for item in json: + characteristics = sorted(item["characteristics"], key=lambda x: x["key"]) + repository = item["repository"][0]["value"] + version = item["version"][0]["value"] + calculated_data.append( + { + "repository": repository, + "version": version, + "characteristics": characteristics, + } + ) + + return calculated_data + except exceptions.MeasureSoftGramCLIException as e: + print_error( + f"[red]Error reading calculated file in {extracted_calculation}: {e}\n" + ) + print_rule() + exit(1) + +def command_norm_diff(args): + try: + planned_path = args["planned_path"] + calculated_path = args["calculated_path"] + except KeyError as e: + logger.error(f"KeyError: args[{e}] - non-existent parameters") + print_error(f"KeyError: args[{e}] - non-existent parameters") + exit(1) + + planned_data = read_json_file(planned_path, sort_key="key") + calculated_data = read_calculated_file(calculated_path) + + planned_vector, calculated_vector = extract_values(planned_data, calculated_data) + norm_diff_value = norm_diff(planned_vector, calculated_vector) + + print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]") + print_info("[#A9A9A9]For more detailed informations use 'diff' command.[/]") + print(f"Norm Diff: {norm_diff_value}") + + print_rule() + +def extract_values(planned_data, calculated_data): + try: + planned = planned_data + calculated = [] + for item in calculated_data: + for characteristic in item['characteristics']: + calculated.append({'key': characteristic['key'], 'value': characteristic['value']}) + + + planned_keys = {item['key'].strip() for item in planned} + calculated_keys = {item['key'].strip() for item in calculated} + + if planned_keys != calculated_keys: + raise exceptions.MeasureSoftGramCLIException( + "Planned and calculated files have different characteristics" + ) + + planned_dict = {item['key'].strip(): item['value'] for item in planned} + calculated_dict = {item['key'].strip(): item['value'] for item in calculated} + + planned_values = [planned_dict[key] for key in planned_keys] + calculated_values = [calculated_dict[key] for key in planned_keys] + + return (np.array(planned_values), np.array(calculated_values)) + except exceptions.MeasureSoftGramCLIException as e: + print_error(f"[red]Error extracting values: {e}\n") + print_rule() + exit(1) From 837ed07d8596bf489a755af3e8ef2452fcf32ab9 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Sat, 27 Jul 2024 16:20:31 -0300 Subject: [PATCH 04/52] Chore: add parser to norm diff command --- src/cli/commands/__init__.py | 1 + src/cli/parsers.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/cli/commands/__init__.py b/src/cli/commands/__init__.py index 1486296d..901e15dd 100644 --- a/src/cli/commands/__init__.py +++ b/src/cli/commands/__init__.py @@ -1,3 +1,4 @@ from src.cli.commands.cmd_init import command_init from src.cli.commands.cmd_extract import command_extract from src.cli.commands.cmd_calculate import command_calculate +from src.cli.commands.cmd_norm_diff import command_norm_diff diff --git a/src/cli/parsers.py b/src/cli/parsers.py index c57ab131..3e2780af 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -6,6 +6,7 @@ from src.cli.commands.cmd_extract import command_extract from src.cli.commands.cmd_calculate import command_calculate from src.cli.commands.cmd_list import command_list +from src.cli.commands.cmd_norm_diff import command_norm_diff from src.config.settings import ( AVAILABLE_IMPORTS, @@ -152,4 +153,26 @@ def create_parser(): ) parser_calculate.set_defaults(func=command_calculate) # function command calculate + # =====================================< COMMAND norm-diff >===================================== + parser_norm_diff = subparsers.add_parser( + "norm-diff", + help="Calculate the norm difference between the planned metrics and the developed.", + ) + + parser_norm_diff.add_argument( + "-p", + "--planned_path", + type=lambda p: Path(p).absolute(), + help="Path to the json with the planned metrics.", + ) + + parser_norm_diff.add_argument( + "-c", + "--calculated_path", + type=lambda p: Path(p).absolute(), + help="Path to the json with the calculated metrics.", + ) + + parser_norm_diff.set_defaults(func=command_norm_diff) # function command list config + return parser From 8aad9363330762047f34c2990a1369f0ce08695d Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Sat, 27 Jul 2024 18:49:55 -0300 Subject: [PATCH 05/52] feat: Adiciona comando diff --- src/cli/commands/cmd_diff.py | 192 +++++++++++++++++++++++++++++++++++ src/cli/parsers.py | 32 ++++++ src/cli/utils.py | 47 +++++++++ src/config/settings.py | 1 + 4 files changed, 272 insertions(+) create mode 100644 src/cli/commands/cmd_diff.py diff --git a/src/cli/commands/cmd_diff.py b/src/cli/commands/cmd_diff.py new file mode 100644 index 00000000..6eb29af2 --- /dev/null +++ b/src/cli/commands/cmd_diff.py @@ -0,0 +1,192 @@ +import csv +import json +import logging +from pathlib import Path + +from rich import print +from rich.console import Console +from staticfiles import DEFAULT_PRE_CONFIG as pre_config + +from core.transformations import diff +from util import ReleasePlannedAndDevelopedOfDifferentSizes + +from src.cli.jsonReader import open_json_file, read_multiple_files +from src.cli.resources.characteristic import calculate_characteristics +from src.cli.resources.measure import calculate_measures +from src.cli.resources.tsqmi import calculate_tsqmi +from src.cli.resources.subcharacteristic import calculate_subcharacteristics +from src.cli.utils import print_diff_table, print_error, print_info, print_panel, print_rule, print_table +from src.cli.aggregate_metrics import aggregate_metrics +from src.cli.exceptions import exceptions +from src.config.settings import DEFAULT_CONFIG_PATH, DIFF_FILE_CONFIG, FILE_CONFIG + +logger = logging.getLogger("msgram") + + +def read_config_file(config_path): + try: + json = open_json_file(config_path / DIFF_FILE_CONFIG) + + return sorted(json, key=lambda x: x['key']) + except exceptions.MeasureSoftGramCLIException as e: + print_error( + f"[red]Error reading msgram_diff.json config file in {config_path}: {e}\n" + ) + print_rule() + exit(1) + + +def read_calculated_file(extracted_calculation): + try: + calculated_data = [] + + json = open_json_file(extracted_calculation) + + for item in json: + characteristics = sorted(item['characteristics'], key=lambda x: x['key']) + repository = item['repository'][0]['value'] + version = item['version'][0]['value'] + + calculated_data.append({ + 'repository': repository, + 'version': version, + 'characteristics': characteristics + }) + + return calculated_data + except exceptions.MeasureSoftGramCLIException as e: + print_error( + f"[red]Error reading calculated file in {extracted_calculation}: {e}\n" + ) + print_rule() + exit(1) + + +def calculate_diff(planned, calculated): + formated_result = [] + + try: + for calculated_item in calculated: + diff_values = [] + if len(calculated_item['characteristics']) != len(planned): + raise ReleasePlannedAndDevelopedOfDifferentSizes( + "The size between planned and developed release vectors is not equal.") + + data_planned, data_calculated = extract_values(planned, calculated_item['characteristics']) + + diff_calculated = diff(data_planned, data_calculated) + + for index in range(len(planned)): + diff_values.append({'key': planned[index]['key'], + 'planned': planned[index]['value'], + 'developed': calculated_item['characteristics'][index]['value'], + 'diff': diff_calculated[index]}) + + formated_result.append({'repository': calculated_item['repository'], + 'version': calculated_item['version'], 'characteristics': diff_values}) + + return formated_result, True + except exceptions.MeasureSoftGramCLIException as e: + print_error(f"[red]Error calculating: {e}\n") + return formated_result, False + + +def command_diff(args): + try: + output_format: str = args["output_format"] + config_path = args["config_path"] + extracted_calculation = args["extracted_calculation"] + + except KeyError as e: + logger.error(f"KeyError: args[{e}] - non-existent parameters") + print_error(f"KeyError: args[{e}] - non-existent parameters") + exit(1) + + console = Console() + console.clear() + print_rule("Calculate") + print_info("> [blue] Reading config file:[/]") + + planned = read_config_file(config_path) + + print_info("\n> [blue] Reading calculated file:[/]") + + calculated = read_calculated_file(extracted_calculation) + + diff_calculated, success = calculate_diff(planned, calculated) + + if success: + print_info("\n[#A9A9A9]Diff calculation performed[/] successfully!") + + show_results(output_format, diff_calculated, config_path) + print_rule() + + print_panel( + title="Done", + menssage="> See our docs for more information: \n" + " https://github.com/fga-eps-mds/2022-2-MeasureSoftGram-CLI", + ) + + +def show_results(output_format, data_calculated, config_path): + show_tabulate(data_calculated) + + if output_format == "csv": + print_info("Exporting CSV...") + export_csv(data_calculated, config_path) + + elif output_format == "json": + print_info("Exporting JSON...") + export_json(data_calculated, config_path) + + +def show_tabulate(data_calculated): + for calculated in data_calculated: + characteristics = {item['key']: {k: v for k, v in item.items() if k != 'key'} + for item in calculated['characteristics']} + print_diff_table(characteristics, f"{calculated['repository']} - {calculated['version']}", "Characteristics") + + +def export_json(data_calculated: list, file_path: Path = DEFAULT_CONFIG_PATH): + file_path = file_path.joinpath("calc_diff_msgram.json") + with open(file_path, "w", encoding="utf-8") as write_file: + json.dump( + data_calculated, + write_file, + indent=4, + ) + print_info(f"[blue]Success:[/] {file_path.name} [blue]exported as JSON") + + +def export_csv(data_calculated: list, file_path: Path = Path("DEFAULT_CONFIG_PATH")): + file_path = file_path.joinpath("calc_diff_msgram.csv") + + with open(file_path, "w", newline="") as csv_file: + fieldnames = ['repository', 'version', 'key', 'planned', 'developed', 'diff'] + writer = csv.DictWriter(csv_file, fieldnames=fieldnames) + + writer.writeheader() + for data in data_calculated: + for row in data['characteristics']: + writer.writerow({ + 'repository': data['repository'], + 'version': data['version'], + **row + }) + + print(f"Success: {file_path.name} exported as CSV") + + +def extract_values(planned, calculated): + vector_calculated = [] + vector_planned = [] + + for x in range(len(planned)): + if (planned[x]['key'] != calculated[x]['key']): + raise exceptions.MeasureSoftGramCLIException( + "Planned and calculated files have differents characteristics") + else: + vector_calculated.append(calculated[x]['value']) + vector_planned.append(planned[x]['value']) + + return vector_planned, vector_calculated diff --git a/src/cli/parsers.py b/src/cli/parsers.py index c57ab131..4561250e 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -2,6 +2,7 @@ from pathlib import Path +from src.cli.commands.cmd_diff import command_diff from src.cli.commands.cmd_init import command_init from src.cli.commands.cmd_extract import command_extract from src.cli.commands.cmd_calculate import command_calculate @@ -152,4 +153,35 @@ def create_parser(): ) parser_calculate.set_defaults(func=command_calculate) # function command calculate + # =====================================< COMMAND diff >===================================== + parser_calculate = subparsers.add_parser( + "diff", + help="Calculates differences between planned and developed values. Returns the result vector.", + ) + + parser_calculate.add_argument( + "-ec", + "--extracted_calculation", + type=lambda p: Path(p).absolute(), + help="Path to the calculated directory", + ) + + parser_calculate.add_argument( + "-cp", + "--config_path", + type=lambda p: Path(p).absolute(), + default=DEFAULT_CONFIG_PATH, + help="Path to the config directory", + ) + + parser_calculate.add_argument( + "-o", + "--output_format", + type=str, + choices=AVAILABLE_GEN_FORMATS, + default="json", + help=("The format of the output (export) values are: ".join(SUPPORTED_FORMATS)), + ) + parser_calculate.set_defaults(func=command_diff) # function command calculate + return parser diff --git a/src/cli/utils.py b/src/cli/utils.py index 44053418..e840cb6a 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -93,3 +93,50 @@ def print_panel(menssage: str, title: str = "Next steps"): width=140, ), ) + +def print_diff_table(the_dict: dict, table_name: str = "", field: str = ""): + table = Table( + title=table_name, + title_style="bold", + row_styles=["none", "dim"], + border_style="bright_yellow", + pad_edge=False, + box=box.MINIMAL, + ) + + table.add_column( + field, + no_wrap=True, + header_style="bold cyan", + footer_style="bright_cian", + style="cyan", + ) + + table.add_column( + "Planned", + no_wrap=True, + header_style="bold red", + footer_style="bright_red", + style="red", + ) + + table.add_column( + "Developed", + no_wrap=True, + header_style="bold red", + footer_style="bright_red", + style="red", + ) + + table.add_column( + "Diff", + no_wrap=True, + header_style="bold red", + footer_style="bright_red", + style="red", + ) + + for field, value in the_dict.items(): + table.add_row(str(field), str(value['planned']), str(value['developed']), str(value['diff'])) + + console.print(table) \ No newline at end of file diff --git a/src/config/settings.py b/src/config/settings.py index 6ad0763d..91d86549 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -4,6 +4,7 @@ DEFAULT_CONFIG_PATH = Path.cwd() / ".msgram" DEFAULT_RAW_DATA_PATH = Path.cwd() / "analytics-raw-data" DEFAULT_CONFIG_FILE_PATH = DEFAULT_CONFIG_PATH / FILE_CONFIG +DIFF_FILE_CONFIG = "msgram_diff.json" AVAILABLE_ENTITIES = [ "metrics", From 40d76f1f58d785783bbfafe99239558ef1d458de Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Sat, 27 Jul 2024 23:00:29 -0300 Subject: [PATCH 06/52] feat: Adiciona testes ao diff --- src/cli/commands/cmd_diff.py | 114 ++++++---- tests/unit/data/calc_exptc_diff_msgram.json | 38 ++++ tests/unit/data/calc_msgram_diff.json | 134 ++++++++++++ tests/unit/data/msgram_diff.json | 10 + tests/unit/data/msgram_diff_different.json | 10 + tests/unit/data/msgram_diff_extra.json | 14 ++ tests/unit/test_diff.py | 226 ++++++++++++++++++++ 7 files changed, 500 insertions(+), 46 deletions(-) create mode 100644 tests/unit/data/calc_exptc_diff_msgram.json create mode 100644 tests/unit/data/calc_msgram_diff.json create mode 100644 tests/unit/data/msgram_diff.json create mode 100644 tests/unit/data/msgram_diff_different.json create mode 100644 tests/unit/data/msgram_diff_extra.json create mode 100644 tests/unit/test_diff.py diff --git a/src/cli/commands/cmd_diff.py b/src/cli/commands/cmd_diff.py index 6eb29af2..fe18c857 100644 --- a/src/cli/commands/cmd_diff.py +++ b/src/cli/commands/cmd_diff.py @@ -5,20 +5,19 @@ from rich import print from rich.console import Console -from staticfiles import DEFAULT_PRE_CONFIG as pre_config from core.transformations import diff -from util import ReleasePlannedAndDevelopedOfDifferentSizes - -from src.cli.jsonReader import open_json_file, read_multiple_files -from src.cli.resources.characteristic import calculate_characteristics -from src.cli.resources.measure import calculate_measures -from src.cli.resources.tsqmi import calculate_tsqmi -from src.cli.resources.subcharacteristic import calculate_subcharacteristics -from src.cli.utils import print_diff_table, print_error, print_info, print_panel, print_rule, print_table -from src.cli.aggregate_metrics import aggregate_metrics + +from src.cli.jsonReader import open_json_file +from src.cli.utils import ( + print_diff_table, + print_error, + print_info, + print_panel, + print_rule, +) from src.cli.exceptions import exceptions -from src.config.settings import DEFAULT_CONFIG_PATH, DIFF_FILE_CONFIG, FILE_CONFIG +from src.config.settings import DEFAULT_CONFIG_PATH, DIFF_FILE_CONFIG logger = logging.getLogger("msgram") @@ -27,7 +26,7 @@ def read_config_file(config_path): try: json = open_json_file(config_path / DIFF_FILE_CONFIG) - return sorted(json, key=lambda x: x['key']) + return sorted(json, key=lambda x: x["key"]) except exceptions.MeasureSoftGramCLIException as e: print_error( f"[red]Error reading msgram_diff.json config file in {config_path}: {e}\n" @@ -43,15 +42,17 @@ def read_calculated_file(extracted_calculation): json = open_json_file(extracted_calculation) for item in json: - characteristics = sorted(item['characteristics'], key=lambda x: x['key']) - repository = item['repository'][0]['value'] - version = item['version'][0]['value'] - - calculated_data.append({ - 'repository': repository, - 'version': version, - 'characteristics': characteristics - }) + characteristics = sorted(item["characteristics"], key=lambda x: x["key"]) + repository = item["repository"][0]["value"] + version = item["version"][0]["value"] + + calculated_data.append( + { + "repository": repository, + "version": version, + "characteristics": characteristics, + } + ) return calculated_data except exceptions.MeasureSoftGramCLIException as e: @@ -68,22 +69,34 @@ def calculate_diff(planned, calculated): try: for calculated_item in calculated: diff_values = [] - if len(calculated_item['characteristics']) != len(planned): - raise ReleasePlannedAndDevelopedOfDifferentSizes( - "The size between planned and developed release vectors is not equal.") + if len(calculated_item["characteristics"]) != len(planned): + raise exceptions.MeasureSoftGramCLIException( + "The size between planned and developed release vectors is not equal." + ) - data_planned, data_calculated = extract_values(planned, calculated_item['characteristics']) + data_planned, data_calculated = extract_values( + planned, calculated_item["characteristics"] + ) diff_calculated = diff(data_planned, data_calculated) for index in range(len(planned)): - diff_values.append({'key': planned[index]['key'], - 'planned': planned[index]['value'], - 'developed': calculated_item['characteristics'][index]['value'], - 'diff': diff_calculated[index]}) - - formated_result.append({'repository': calculated_item['repository'], - 'version': calculated_item['version'], 'characteristics': diff_values}) + diff_values.append( + { + "key": planned[index]["key"], + "planned": planned[index]["value"], + "developed": calculated_item["characteristics"][index]["value"], + "diff": diff_calculated[index], + } + ) + + formated_result.append( + { + "repository": calculated_item["repository"], + "version": calculated_item["version"], + "characteristics": diff_values, + } + ) return formated_result, True except exceptions.MeasureSoftGramCLIException as e: @@ -142,9 +155,15 @@ def show_results(output_format, data_calculated, config_path): def show_tabulate(data_calculated): for calculated in data_calculated: - characteristics = {item['key']: {k: v for k, v in item.items() if k != 'key'} - for item in calculated['characteristics']} - print_diff_table(characteristics, f"{calculated['repository']} - {calculated['version']}", "Characteristics") + characteristics = { + item["key"]: {k: v for k, v in item.items() if k != "key"} + for item in calculated["characteristics"] + } + print_diff_table( + characteristics, + f"{calculated['repository']} - {calculated['version']}", + "Characteristics", + ) def export_json(data_calculated: list, file_path: Path = DEFAULT_CONFIG_PATH): @@ -162,17 +181,19 @@ def export_csv(data_calculated: list, file_path: Path = Path("DEFAULT_CONFIG_PAT file_path = file_path.joinpath("calc_diff_msgram.csv") with open(file_path, "w", newline="") as csv_file: - fieldnames = ['repository', 'version', 'key', 'planned', 'developed', 'diff'] + fieldnames = ["repository", "version", "key", "planned", "developed", "diff"] writer = csv.DictWriter(csv_file, fieldnames=fieldnames) writer.writeheader() for data in data_calculated: - for row in data['characteristics']: - writer.writerow({ - 'repository': data['repository'], - 'version': data['version'], - **row - }) + for row in data["characteristics"]: + writer.writerow( + { + "repository": data["repository"], + "version": data["version"], + **row, + } + ) print(f"Success: {file_path.name} exported as CSV") @@ -182,11 +203,12 @@ def extract_values(planned, calculated): vector_planned = [] for x in range(len(planned)): - if (planned[x]['key'] != calculated[x]['key']): + if planned[x]["key"] != calculated[x]["key"]: raise exceptions.MeasureSoftGramCLIException( - "Planned and calculated files have differents characteristics") + "Planned and calculated files have differents characteristics" + ) else: - vector_calculated.append(calculated[x]['value']) - vector_planned.append(planned[x]['value']) + vector_calculated.append(calculated[x]["value"]) + vector_planned.append(planned[x]["value"]) return vector_planned, vector_calculated diff --git a/tests/unit/data/calc_exptc_diff_msgram.json b/tests/unit/data/calc_exptc_diff_msgram.json new file mode 100644 index 00000000..2070bc2f --- /dev/null +++ b/tests/unit/data/calc_exptc_diff_msgram.json @@ -0,0 +1,38 @@ +[ + { + "repository": "fga-eps-mds-2022-2-MeasureSoftGram-CLI", + "version": "01-05-2023-21-40", + "characteristics": [ + { + "key": "maintainability", + "planned": 0.95, + "developed": 0.6415437113263573, + "diff": 0.3084562886736426 + }, + { + "key": "reliability", + "planned": 0.95, + "developed": 0.8421061048464034, + "diff": 0.1078938951535966 + } + ] + }, + { + "repository": "fga-eps-mds-2022-3-MeasureSoftGram-CLI", + "version": "01-05-2023-21-40", + "characteristics": [ + { + "key": "maintainability", + "planned": 0.95, + "developed": 0.55, + "diff": 0.3999999999999999 + }, + { + "key": "reliability", + "planned": 0.95, + "developed": 0.75, + "diff": 0.19999999999999996 + } + ] + } +] \ No newline at end of file diff --git a/tests/unit/data/calc_msgram_diff.json b/tests/unit/data/calc_msgram_diff.json new file mode 100644 index 00000000..3147f6a1 --- /dev/null +++ b/tests/unit/data/calc_msgram_diff.json @@ -0,0 +1,134 @@ +[ + { + "repository": [ + { + "key": "repository", + "value": "fga-eps-mds-2022-2-MeasureSoftGram-CLI" + } + ], + "version": [ + { + "key": "version", + "value": "01-05-2023-21-40" + } + ], + "measures": [ + { + "key": "passed_tests", + "value": 1.0 + }, + { + "key": "test_builds", + "value": 0.9996066627522133 + }, + { + "key": "test_coverage", + "value": 0.40234848484848484 + }, + { + "key": "non_complex_file_density", + "value": 0.44347274991556906 + }, + { + "key": "commented_file_density", + "value": 0.04318181818181818 + }, + { + "key": "duplication_absense", + "value": 1.0 + } + ], + "subcharacteristics": [ + { + "key": "testing_status", + "value": 0.8421061048464034 + }, + { + "key": "modifiability", + "value": 0.6415437113263573 + } + ], + "characteristics": [ + { + "key": "reliability", + "value": 0.8421061048464034 + }, + { + "key": "maintainability", + "value": 0.6415437113263573 + } + ], + "tsqmi": [ + { + "key": "tsqmi", + "value": 0.7485723162667646 + } + ] + }, + { + "repository": [ + { + "key": "repository", + "value": "fga-eps-mds-2022-3-MeasureSoftGram-CLI" + } + ], + "version": [ + { + "key": "version", + "value": "01-05-2023-21-40" + } + ], + "measures": [ + { + "key": "passed_tests", + "value": 1.0 + }, + { + "key": "test_builds", + "value": 0.9996066627522133 + }, + { + "key": "test_coverage", + "value": 0.40234848484848484 + }, + { + "key": "non_complex_file_density", + "value": 0.44347274991556906 + }, + { + "key": "commented_file_density", + "value": 0.04318181818181818 + }, + { + "key": "duplication_absense", + "value": 1.0 + } + ], + "subcharacteristics": [ + { + "key": "testing_status", + "value": 0.8421061048464034 + }, + { + "key": "modifiability", + "value": 0.6415437113263573 + } + ], + "characteristics": [ + { + "key": "reliability", + "value": 0.75 + }, + { + "key": "maintainability", + "value": 0.55 + } + ], + "tsqmi": [ + { + "key": "tsqmi", + "value": 0.7485723162667646 + } + ] + } +] \ No newline at end of file diff --git a/tests/unit/data/msgram_diff.json b/tests/unit/data/msgram_diff.json new file mode 100644 index 00000000..2e7712b8 --- /dev/null +++ b/tests/unit/data/msgram_diff.json @@ -0,0 +1,10 @@ +[ + { + "key": "reliability", + "value": 0.95 + }, + { + "key": "maintainability", + "value": 0.95 + } +] diff --git a/tests/unit/data/msgram_diff_different.json b/tests/unit/data/msgram_diff_different.json new file mode 100644 index 00000000..f945367d --- /dev/null +++ b/tests/unit/data/msgram_diff_different.json @@ -0,0 +1,10 @@ +[ + { + "key": "reliability", + "value": 0.95 + }, + { + "key": "functional_suitability ", + "value": 0.95 + } +] diff --git a/tests/unit/data/msgram_diff_extra.json b/tests/unit/data/msgram_diff_extra.json new file mode 100644 index 00000000..6025b95e --- /dev/null +++ b/tests/unit/data/msgram_diff_extra.json @@ -0,0 +1,14 @@ +[ + { + "key": "reliability", + "value": 0.95 + }, + { + "key": "maintainability", + "value": 0.95 + }, + { + "key": "functional_suitability ", + "value": 0.95 + } +] diff --git a/tests/unit/test_diff.py b/tests/unit/test_diff.py new file mode 100644 index 00000000..d363d7b4 --- /dev/null +++ b/tests/unit/test_diff.py @@ -0,0 +1,226 @@ +import copy + +import json +import shutil +import sys +from io import StringIO +from pathlib import Path +import tempfile + +import pytest + +from src.cli.commands.cmd_diff import command_diff + +CALCULATE_ARGS = { + "output_format": "json", + "config_path": Path(""), + "extracted_calculation": Path(""), +} + + +@pytest.mark.parametrize( + "diff_arg", ["output_format", "config_path", "extracted_calculation"] +) +def test_diff_invalid_args(diff_arg): + captured_output = StringIO() + sys.stdout = captured_output + + args = copy.deepcopy(CALCULATE_ARGS) + del args[diff_arg] + + with pytest.raises(SystemExit): + command_diff(args) + + sys.stdout = sys.__stdout__ + assert ( + f"KeyError: args['{diff_arg}'] - non-existent parameters" + in captured_output.getvalue() + ) + + +def test_diff_file(): + config_dirpath = tempfile.mkdtemp() + + shutil.copy( + "tests/unit/data/msgram_diff.json", f"{config_dirpath}/msgram_diff.json" + ) + shutil.copy( + "tests/unit/data/calc_msgram_diff.json", + f"{config_dirpath}/calc_msgram_diff.json", + ) + shutil.copy( + "tests/unit/data/calc_exptc_diff_msgram.json", + f"{config_dirpath}/calc_exptc_diff_msgram.json", + ) + + args = { + "output_format": "json", + "config_path": Path(config_dirpath), + "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + } + + command_diff(args) + + with open(config_dirpath + "/calc_diff_msgram.json", "r") as f: + output_data = json.load(f) + + with open(config_dirpath + "/calc_exptc_diff_msgram.json", "r") as f: + expected_data = json.load(f) + + assert output_data == expected_data + + shutil.rmtree(config_dirpath) + + +def test_diff_invalid_config_file(): + captured_output = StringIO() + sys.stdout = captured_output + + config_dirpath = tempfile.mkdtemp() + + shutil.copy( + "tests/unit/data/invalid_json.json", f"{config_dirpath}/invalid_json.json" + ) + + args = { + "output_format": "csv", + "config_path": Path(config_dirpath), + "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + } + + with pytest.raises(SystemExit): + command_diff(args) + + sys.stdout = sys.__stdout__ + assert ( + f"Error reading msgram_diff.json config file in {config_dirpath}" + in captured_output.getvalue() + ) + + shutil.rmtree(config_dirpath) + + +def test_diff_invalid_calculated_file(): + captured_output = StringIO() + sys.stdout = captured_output + + config_dirpath = tempfile.mkdtemp() + + shutil.copy( + "tests/unit/data/msgram_diff.json", f"{config_dirpath}/msgram_diff.json" + ) + + args = { + "output_format": "csv", + "config_path": Path(config_dirpath), + "extracted_calculation": Path(config_dirpath + "/calc_msgram_error.json"), + } + + with pytest.raises(SystemExit): + command_diff(args) + + sys.stdout = sys.__stdout__ + assert ( + f"Error reading calculated file in {config_dirpath}" + in captured_output.getvalue() + ) + + shutil.rmtree(config_dirpath) + + +def test_diff_invalid_vectors_size(): + captured_output = StringIO() + sys.stdout = captured_output + + config_dirpath = tempfile.mkdtemp() + + shutil.copy( + "tests/unit/data/msgram_diff_extra.json", + f"{config_dirpath}/msgram_diff.json", + ) + shutil.copy( + "tests/unit/data/calc_msgram_diff.json", + f"{config_dirpath}/calc_msgram_diff.json", + ) + + args = { + "output_format": "csv", + "config_path": Path(config_dirpath), + "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + } + + command_diff(args) + + sys.stdout = sys.__stdout__ + assert ( + "Error calculating: The size between planned and developed release vectors is not equal." + in captured_output.getvalue() + ) + + shutil.rmtree(config_dirpath) + + +def test_diff_differents_characteristics(): + captured_output = StringIO() + sys.stdout = captured_output + + config_dirpath = tempfile.mkdtemp() + + shutil.copy( + "tests/unit/data/msgram_diff_different.json", + f"{config_dirpath}/msgram_diff.json", + ) + shutil.copy( + "tests/unit/data/calc_msgram_diff.json", + f"{config_dirpath}/calc_msgram_diff.json", + ) + + args = { + "output_format": "csv", + "config_path": Path(config_dirpath), + "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + } + + command_diff(args) + + sys.stdout = sys.__stdout__ + assert ( + "Planned and calculated files have differents characteristics" + in captured_output.getvalue() + ) + + shutil.rmtree(config_dirpath) + + +# def test_calculate_invalid_extracted_file(): +# captured_output = StringIO() +# sys.stdout = captured_output + +# config_dirpath = tempfile.mkdtemp() +# extract_dirpath = tempfile.mkdtemp() + +# shutil.copy("tests/unit/data/msgram.json", f"{config_dirpath}/msgram.json") + +# extracted_file_name = "invalid_json.json" +# shutil.copy( +# f"tests/unit/data/{extracted_file_name}", +# f"{extract_dirpath}/{extracted_file_name}", +# ) + +# args = { +# "output_format": "csv", +# "config_path": Path(config_dirpath), +# "extracted_path": Path(extract_dirpath + f"/{extracted_file_name}"), +# } + +# command_calculate(args) + +# sys.stdout = sys.__stdout__ +# assert ( +# f"Error calculating {extract_dirpath}/{extracted_file_name}" +# in captured_output.getvalue() +# ) +# assert "All calculations performed" not in captured_output.getvalue() + +# shutil.rmtree(config_dirpath) +# shutil.rmtree(extract_dirpath) From 9fc994e3e65302a0bdfb64b7736f61a2525d735d Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Sat, 27 Jul 2024 23:05:54 -0300 Subject: [PATCH 07/52] fix: Ajusta linter --- src/cli/aggregate_metrics.py | 12 +++--- src/cli/commands/cmd_calculate.py | 23 +++++++---- src/cli/utils.py | 10 ++++- tests/unit/test_aggregate.py | 29 +++++++++---- tests/unit/test_calculate.py | 44 ++++++++++---------- tests/unit/test_parser.py | 67 +++++++++++++++++++------------ 6 files changed, 114 insertions(+), 71 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index f35fc282..19d76793 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -127,7 +127,9 @@ def process_github_metrics(folder_path, github_files, metrics): github_file_content = read_msgram(github_file_path) if not github_file_content: - print_error(f"> [red] Error to read github metrics in: {github_file_path}\n") + print_error( + f"> [red] Error to read github metrics in: {github_file_path}\n" + ) continue github_key = next(iter(github_file_content.keys() - metrics["sonar"]), "") @@ -155,9 +157,9 @@ def process_github_metrics(folder_path, github_files, metrics): def find_common_part(sonar_filename, github_result): sonar_filename_root, _ = os.path.splitext(sonar_filename) - sonar_parts = sonar_filename_root.split('-') + sonar_parts = sonar_filename_root.split("-") if len(sonar_parts) >= 7: - sonar_key = '-'.join(sonar_parts[:7]) + sonar_key = "-".join(sonar_parts[:7]) for github_filename, github_metrics in github_result: github_filename_root, _ = os.path.splitext(github_filename) @@ -187,9 +189,7 @@ def aggregate_metrics(folder_path, config: json): config_has_github = should_process_github_metrics(config) if config_has_github: - github_result = process_github_metrics( - folder_path, github_files, metrics - ) + github_result = process_github_metrics(folder_path, github_files, metrics) if not github_result: print_error("> [red]Error: Unexpected result from process_github_metrics") diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 1ecc4579..8935949c 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -118,12 +118,14 @@ def calculate_all(json_data, file_name, config): "repository": [{"key": "repository", "value": repository}], "version": [{"key": "version", "value": version}] if version else [], "measures": data_measures["measures"] if data_measures else [], - "subcharacteristics": data_subcharacteristics["subcharacteristics"] - if data_subcharacteristics - else [], - "characteristics": data_characteristics["characteristics"] - if data_characteristics - else [], + "subcharacteristics": ( + data_subcharacteristics["subcharacteristics"] + if data_subcharacteristics + else [] + ), + "characteristics": ( + data_characteristics["characteristics"] if data_characteristics else [] + ), "tsqmi": data_tsqmi["tsqmi"] if data_tsqmi else [], } @@ -186,12 +188,17 @@ def show_tree(data_calculated, pre_config): for subchar_c in char_c["subcharacteristics"]: subchar = get_obj_by_element(subcharacteristics, "key", subchar_c["key"]) if subchar: - sub_char_tree = Node(f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree) + sub_char_tree = Node( + f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree + ) for measure_c in subchar_c["measures"]: measure = get_obj_by_element(measures, "key", measure_c["key"]) if measure: - Node(f"[yellow]{measure['key']} {measure['value']}", parent=sub_char_tree) + Node( + f"[yellow]{measure['key']} {measure['value']}", + parent=sub_char_tree, + ) for pre, fill, node in RenderTree(tsqmi_tree): print(f"{pre}{node.name}") diff --git a/src/cli/utils.py b/src/cli/utils.py index e840cb6a..b47e0f20 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -94,6 +94,7 @@ def print_panel(menssage: str, title: str = "Next steps"): ), ) + def print_diff_table(the_dict: dict, table_name: str = "", field: str = ""): table = Table( title=table_name, @@ -137,6 +138,11 @@ def print_diff_table(the_dict: dict, table_name: str = "", field: str = ""): ) for field, value in the_dict.items(): - table.add_row(str(field), str(value['planned']), str(value['developed']), str(value['diff'])) + table.add_row( + str(field), + str(value["planned"]), + str(value["developed"]), + str(value["diff"]), + ) - console.print(table) \ No newline at end of file + console.print(table) diff --git a/tests/unit/test_aggregate.py b/tests/unit/test_aggregate.py index 17110739..1e05c642 100644 --- a/tests/unit/test_aggregate.py +++ b/tests/unit/test_aggregate.py @@ -13,7 +13,7 @@ process_github_metrics, process_sonar_metrics, aggregate_metrics, - find_common_part + find_common_part, ) @@ -93,7 +93,9 @@ def test_process_github_metrics(): metrics = {"sonar": ["some_metric"], "github": ["resolved_issues", "total_issues"]} - result = process_github_metrics(folder_path, [github_file_name, github_file_name], metrics) + result = process_github_metrics( + folder_path, [github_file_name, github_file_name], metrics + ) expected_result = ( github_file_name, @@ -152,10 +154,12 @@ def test_aggregate_metrics(): folder_path = temp_dir msgram_file1 = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram", ) msgram_file2 = os.path.join( - folder_path, "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram" + folder_path, + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", ) with open(msgram_file1, "w") as file: @@ -177,7 +181,8 @@ def test_aggregate_metrics(): assert result is True output_file_path = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics", ) assert os.path.exists(output_file_path) @@ -200,11 +205,19 @@ def test_aggregate_metrics(): def test_find_common_part(): sonar_filename = "fga-eps-mds-2023-2-MeasureSoftGram-Parser-02-06-2023-21-40-30-develop-extracted" github_files = [ - ("github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", "Metrics1"), - ("github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", "Metrics2") + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", + "Metrics1", + ), + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", + "Metrics2", + ), ] - with patch("builtins.print"): # Mocking the print function to avoid print statements during testing + with patch( + "builtins.print" + ): # Mocking the print function to avoid print statements during testing result = find_common_part(sonar_filename, github_files) assert result == "Metrics1" diff --git a/tests/unit/test_calculate.py b/tests/unit/test_calculate.py index 0b2bbcbb..36c6228c 100644 --- a/tests/unit/test_calculate.py +++ b/tests/unit/test_calculate.py @@ -23,30 +23,32 @@ def test_show_tree(capfd): data_calculated = { - 'repository': [{'key': 'repository', 'value': 'fga-eps-mds-2022-2-MeasureSoftGram-CLI'}], - 'version': [{'key': 'version', 'value': '01-05-2023-21-40'}], - 'measures': [ - {'key': 'passed_tests', 'value': 1.0}, - {'key': 'test_builds', 'value': 0.9996066627522133}, - {'key': 'test_coverage', 'value': 0.40234848484848484}, - {'key': 'non_complex_file_density', 'value': 0.44347274991556906}, - {'key': 'commented_file_density', 'value': 0.04318181818181818}, - {'key': 'duplication_absence', 'value': 1.0}, - {'key': 'team_throughput', 'value': 0.6969696969696971}, - {'key': 'ci_feedback_time', 'value': 0.06117908787541713} + "repository": [ + {"key": "repository", "value": "fga-eps-mds-2022-2-MeasureSoftGram-CLI"} + ], + "version": [{"key": "version", "value": "01-05-2023-21-40"}], + "measures": [ + {"key": "passed_tests", "value": 1.0}, + {"key": "test_builds", "value": 0.9996066627522133}, + {"key": "test_coverage", "value": 0.40234848484848484}, + {"key": "non_complex_file_density", "value": 0.44347274991556906}, + {"key": "commented_file_density", "value": 0.04318181818181818}, + {"key": "duplication_absence", "value": 1.0}, + {"key": "team_throughput", "value": 0.6969696969696971}, + {"key": "ci_feedback_time", "value": 0.06117908787541713}, ], - 'subcharacteristics': [ - {'key': 'testing_status', 'value': 0.8421061048464034}, - {'key': 'maturity', 'value': 0.06117908787541713}, - {'key': 'modifiability', 'value': 0.6415437113263573}, - {'key': 'functional_completeness', 'value': 0.6969696969696971} + "subcharacteristics": [ + {"key": "testing_status", "value": 0.8421061048464034}, + {"key": "maturity", "value": 0.06117908787541713}, + {"key": "modifiability", "value": 0.6415437113263573}, + {"key": "functional_completeness", "value": 0.6969696969696971}, ], - 'characteristics': [ - {'key': 'reliability', 'value': 0.5970282960684735}, - {'key': 'maintainability', 'value': 0.6415437113263573}, - {'key': 'functional_suitability', 'value': 0.6969696969696971} + "characteristics": [ + {"key": "reliability", "value": 0.5970282960684735}, + {"key": "maintainability", "value": 0.6415437113263573}, + {"key": "functional_suitability", "value": 0.6969696969696971}, ], - 'tsqmi': [{'key': 'tsqmi', 'value': 0.6455181338484177}] + "tsqmi": [{"key": "tsqmi", "value": 0.6455181338484177}], } expected_output = ( diff --git a/tests/unit/test_parser.py b/tests/unit/test_parser.py index 5c0894ab..56320009 100644 --- a/tests/unit/test_parser.py +++ b/tests/unit/test_parser.py @@ -25,46 +25,61 @@ def mock_command_list(args): def test_parser_init(): parser = create_parser() - args = parser.parse_args(['init', '-cp', '/path/to/config']) + args = parser.parse_args(["init", "-cp", "/path/to/config"]) assert args.func == command_init - assert args.config_path == Path('/path/to/config') + assert args.config_path == Path("/path/to/config") def test_parser_list(): parser = create_parser() - args = parser.parse_args(['list', '-cp', '/path/to/config', 'all']) + args = parser.parse_args(["list", "-cp", "/path/to/config", "all"]) assert args.func == command_list - assert args.config_path == Path('/path/to/config') - assert args.all == 'all' + assert args.config_path == Path("/path/to/config") + assert args.all == "all" def test_parser_extract(): parser = create_parser() - args = parser.parse_args(['extract', - '-o', - 'sonarqube', - '-dp', - '/path/to/data', - '-ep', - '/path/to/extracted', - '-le', - 'py', - '-rep', - '/path/to/repo']) + args = parser.parse_args( + [ + "extract", + "-o", + "sonarqube", + "-dp", + "/path/to/data", + "-ep", + "/path/to/extracted", + "-le", + "py", + "-rep", + "/path/to/repo", + ] + ) assert args.func == command_extract - assert args.output_origin == 'sonarqube' - assert args.data_path == Path('/path/to/data') - assert args.extracted_path == Path('/path/to/extracted') - assert args.language_extension == 'py' - assert args.repository_path == '/path/to/repo' + assert args.output_origin == "sonarqube" + assert args.data_path == Path("/path/to/data") + assert args.extracted_path == Path("/path/to/extracted") + assert args.language_extension == "py" + assert args.repository_path == "/path/to/repo" def test_parser_calculate(): parser = create_parser() - args = parser.parse_args(['calculate', 'all', '-ep', '/path/to/extracted', '-cp', '/path/to/config', '-o', 'csv']) + args = parser.parse_args( + [ + "calculate", + "all", + "-ep", + "/path/to/extracted", + "-cp", + "/path/to/config", + "-o", + "csv", + ] + ) assert args.func == command_calculate - assert args.all == 'all' - assert args.extracted_path == Path('/path/to/extracted') - assert args.config_path == Path('/path/to/config') - assert args.output_format == 'csv' + assert args.all == "all" + assert args.extracted_path == Path("/path/to/extracted") + assert args.config_path == Path("/path/to/config") + assert args.output_format == "csv" From 848e03e5fe15cec3957a6a9da6e13242d502724e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 28 Jul 2024 00:05:09 -0300 Subject: [PATCH 08/52] =?UTF-8?q?BUG006=20-=20Adi=C3=A7=C3=A3o=20de=20par?= =?UTF-8?q?=C3=A2metro=20e=20tratamento=20de=20erros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_extract.py | 12 +++++++++++- src/cli/parsers.py | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index e1a9d690..cd1bec1b 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -56,6 +56,15 @@ def command_extract(args): print_warn(f"KeyError: args[{e}] - non-existent parameters") exit(1) + if args["labels"] and output_origin == "sonarqube": + logger.error( + 'Error: The parameter "-lb" must accompany a github repository output' + ) + print_warn( + 'Error: The parameter "-lb" must accompany a github repository output' + ) + sys.exit(1) + if data_path is None and repository_path is None: logger.error( "It is necessary to pass the data_path or repository_path parameters" @@ -71,7 +80,8 @@ def command_extract(args): parser = GenericParser() if repository_path and output_origin == "github": - result = parser.parse(input_value=repository_path, type_input=output_origin) + filters = {"labels": args["label"]} + result = parser.parse(input_value=repository_path, type_input=output_origin, filters=filters) repository_name = repository_path.replace("/", "-") save_file_with_results( ".msgram", diff --git a/src/cli/parsers.py b/src/cli/parsers.py index c57ab131..3c29acdd 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -95,6 +95,16 @@ def create_parser(): help="Path to the extracted directory", ) + parser_extract.add_argument( + "-lb", + "--label", + type=str, + default="US,User Story,User Stories", + help=( + "Selected label name for extracted user story issues. Format 'XX YY'. Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" + ), + ) + parser_extract.add_argument( "-le", "--language_extension", From c2a6c40dfbffa415965996fe389ca1108885fa61 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 28 Jul 2024 01:27:22 -0300 Subject: [PATCH 09/52] =?UTF-8?q?BUG006=20Flake=20e=20corre=C3=A7=C3=B5es?= =?UTF-8?q?=20de=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/aggregate_metrics.py | 12 +++--- src/cli/commands/cmd_calculate.py | 23 +++++++---- src/cli/commands/cmd_extract.py | 10 +++-- src/cli/parsers.py | 3 +- tests/unit/test_aggregate.py | 29 +++++++++---- tests/unit/test_calculate.py | 44 ++++++++++---------- tests/unit/test_parser.py | 67 +++++++++++++++++++------------ 7 files changed, 115 insertions(+), 73 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index f35fc282..19d76793 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -127,7 +127,9 @@ def process_github_metrics(folder_path, github_files, metrics): github_file_content = read_msgram(github_file_path) if not github_file_content: - print_error(f"> [red] Error to read github metrics in: {github_file_path}\n") + print_error( + f"> [red] Error to read github metrics in: {github_file_path}\n" + ) continue github_key = next(iter(github_file_content.keys() - metrics["sonar"]), "") @@ -155,9 +157,9 @@ def process_github_metrics(folder_path, github_files, metrics): def find_common_part(sonar_filename, github_result): sonar_filename_root, _ = os.path.splitext(sonar_filename) - sonar_parts = sonar_filename_root.split('-') + sonar_parts = sonar_filename_root.split("-") if len(sonar_parts) >= 7: - sonar_key = '-'.join(sonar_parts[:7]) + sonar_key = "-".join(sonar_parts[:7]) for github_filename, github_metrics in github_result: github_filename_root, _ = os.path.splitext(github_filename) @@ -187,9 +189,7 @@ def aggregate_metrics(folder_path, config: json): config_has_github = should_process_github_metrics(config) if config_has_github: - github_result = process_github_metrics( - folder_path, github_files, metrics - ) + github_result = process_github_metrics(folder_path, github_files, metrics) if not github_result: print_error("> [red]Error: Unexpected result from process_github_metrics") diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 1ecc4579..8935949c 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -118,12 +118,14 @@ def calculate_all(json_data, file_name, config): "repository": [{"key": "repository", "value": repository}], "version": [{"key": "version", "value": version}] if version else [], "measures": data_measures["measures"] if data_measures else [], - "subcharacteristics": data_subcharacteristics["subcharacteristics"] - if data_subcharacteristics - else [], - "characteristics": data_characteristics["characteristics"] - if data_characteristics - else [], + "subcharacteristics": ( + data_subcharacteristics["subcharacteristics"] + if data_subcharacteristics + else [] + ), + "characteristics": ( + data_characteristics["characteristics"] if data_characteristics else [] + ), "tsqmi": data_tsqmi["tsqmi"] if data_tsqmi else [], } @@ -186,12 +188,17 @@ def show_tree(data_calculated, pre_config): for subchar_c in char_c["subcharacteristics"]: subchar = get_obj_by_element(subcharacteristics, "key", subchar_c["key"]) if subchar: - sub_char_tree = Node(f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree) + sub_char_tree = Node( + f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree + ) for measure_c in subchar_c["measures"]: measure = get_obj_by_element(measures, "key", measure_c["key"]) if measure: - Node(f"[yellow]{measure['key']} {measure['value']}", parent=sub_char_tree) + Node( + f"[yellow]{measure['key']} {measure['value']}", + parent=sub_char_tree, + ) for pre, fill, node in RenderTree(tsqmi_tree): print(f"{pre}{node.name}") diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index cd1bec1b..5849d913 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -56,7 +56,7 @@ def command_extract(args): print_warn(f"KeyError: args[{e}] - non-existent parameters") exit(1) - if args["labels"] and output_origin == "sonarqube": + if args["label"] and output_origin == "sonarqube": logger.error( 'Error: The parameter "-lb" must accompany a github repository output' ) @@ -80,8 +80,12 @@ def command_extract(args): parser = GenericParser() if repository_path and output_origin == "github": - filters = {"labels": args["label"]} - result = parser.parse(input_value=repository_path, type_input=output_origin, filters=filters) + filters = { + "labels": args["label"] if args["label"] else "US,User Story,User Stories" + } + result = parser.parse( + input_value=repository_path, type_input=output_origin, filters=filters + ) repository_name = repository_path.replace("/", "-") save_file_with_results( ".msgram", diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 3c29acdd..2e41a882 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -101,7 +101,8 @@ def create_parser(): type=str, default="US,User Story,User Stories", help=( - "Selected label name for extracted user story issues. Format 'XX YY'. Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" + "Selected label name for extracted user story issues. Format 'XX YY'" + + " Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" ), ) diff --git a/tests/unit/test_aggregate.py b/tests/unit/test_aggregate.py index 17110739..1e05c642 100644 --- a/tests/unit/test_aggregate.py +++ b/tests/unit/test_aggregate.py @@ -13,7 +13,7 @@ process_github_metrics, process_sonar_metrics, aggregate_metrics, - find_common_part + find_common_part, ) @@ -93,7 +93,9 @@ def test_process_github_metrics(): metrics = {"sonar": ["some_metric"], "github": ["resolved_issues", "total_issues"]} - result = process_github_metrics(folder_path, [github_file_name, github_file_name], metrics) + result = process_github_metrics( + folder_path, [github_file_name, github_file_name], metrics + ) expected_result = ( github_file_name, @@ -152,10 +154,12 @@ def test_aggregate_metrics(): folder_path = temp_dir msgram_file1 = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram", ) msgram_file2 = os.path.join( - folder_path, "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram" + folder_path, + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", ) with open(msgram_file1, "w") as file: @@ -177,7 +181,8 @@ def test_aggregate_metrics(): assert result is True output_file_path = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics", ) assert os.path.exists(output_file_path) @@ -200,11 +205,19 @@ def test_aggregate_metrics(): def test_find_common_part(): sonar_filename = "fga-eps-mds-2023-2-MeasureSoftGram-Parser-02-06-2023-21-40-30-develop-extracted" github_files = [ - ("github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", "Metrics1"), - ("github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", "Metrics2") + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", + "Metrics1", + ), + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", + "Metrics2", + ), ] - with patch("builtins.print"): # Mocking the print function to avoid print statements during testing + with patch( + "builtins.print" + ): # Mocking the print function to avoid print statements during testing result = find_common_part(sonar_filename, github_files) assert result == "Metrics1" diff --git a/tests/unit/test_calculate.py b/tests/unit/test_calculate.py index 0b2bbcbb..36c6228c 100644 --- a/tests/unit/test_calculate.py +++ b/tests/unit/test_calculate.py @@ -23,30 +23,32 @@ def test_show_tree(capfd): data_calculated = { - 'repository': [{'key': 'repository', 'value': 'fga-eps-mds-2022-2-MeasureSoftGram-CLI'}], - 'version': [{'key': 'version', 'value': '01-05-2023-21-40'}], - 'measures': [ - {'key': 'passed_tests', 'value': 1.0}, - {'key': 'test_builds', 'value': 0.9996066627522133}, - {'key': 'test_coverage', 'value': 0.40234848484848484}, - {'key': 'non_complex_file_density', 'value': 0.44347274991556906}, - {'key': 'commented_file_density', 'value': 0.04318181818181818}, - {'key': 'duplication_absence', 'value': 1.0}, - {'key': 'team_throughput', 'value': 0.6969696969696971}, - {'key': 'ci_feedback_time', 'value': 0.06117908787541713} + "repository": [ + {"key": "repository", "value": "fga-eps-mds-2022-2-MeasureSoftGram-CLI"} + ], + "version": [{"key": "version", "value": "01-05-2023-21-40"}], + "measures": [ + {"key": "passed_tests", "value": 1.0}, + {"key": "test_builds", "value": 0.9996066627522133}, + {"key": "test_coverage", "value": 0.40234848484848484}, + {"key": "non_complex_file_density", "value": 0.44347274991556906}, + {"key": "commented_file_density", "value": 0.04318181818181818}, + {"key": "duplication_absence", "value": 1.0}, + {"key": "team_throughput", "value": 0.6969696969696971}, + {"key": "ci_feedback_time", "value": 0.06117908787541713}, ], - 'subcharacteristics': [ - {'key': 'testing_status', 'value': 0.8421061048464034}, - {'key': 'maturity', 'value': 0.06117908787541713}, - {'key': 'modifiability', 'value': 0.6415437113263573}, - {'key': 'functional_completeness', 'value': 0.6969696969696971} + "subcharacteristics": [ + {"key": "testing_status", "value": 0.8421061048464034}, + {"key": "maturity", "value": 0.06117908787541713}, + {"key": "modifiability", "value": 0.6415437113263573}, + {"key": "functional_completeness", "value": 0.6969696969696971}, ], - 'characteristics': [ - {'key': 'reliability', 'value': 0.5970282960684735}, - {'key': 'maintainability', 'value': 0.6415437113263573}, - {'key': 'functional_suitability', 'value': 0.6969696969696971} + "characteristics": [ + {"key": "reliability", "value": 0.5970282960684735}, + {"key": "maintainability", "value": 0.6415437113263573}, + {"key": "functional_suitability", "value": 0.6969696969696971}, ], - 'tsqmi': [{'key': 'tsqmi', 'value': 0.6455181338484177}] + "tsqmi": [{"key": "tsqmi", "value": 0.6455181338484177}], } expected_output = ( diff --git a/tests/unit/test_parser.py b/tests/unit/test_parser.py index 5c0894ab..56320009 100644 --- a/tests/unit/test_parser.py +++ b/tests/unit/test_parser.py @@ -25,46 +25,61 @@ def mock_command_list(args): def test_parser_init(): parser = create_parser() - args = parser.parse_args(['init', '-cp', '/path/to/config']) + args = parser.parse_args(["init", "-cp", "/path/to/config"]) assert args.func == command_init - assert args.config_path == Path('/path/to/config') + assert args.config_path == Path("/path/to/config") def test_parser_list(): parser = create_parser() - args = parser.parse_args(['list', '-cp', '/path/to/config', 'all']) + args = parser.parse_args(["list", "-cp", "/path/to/config", "all"]) assert args.func == command_list - assert args.config_path == Path('/path/to/config') - assert args.all == 'all' + assert args.config_path == Path("/path/to/config") + assert args.all == "all" def test_parser_extract(): parser = create_parser() - args = parser.parse_args(['extract', - '-o', - 'sonarqube', - '-dp', - '/path/to/data', - '-ep', - '/path/to/extracted', - '-le', - 'py', - '-rep', - '/path/to/repo']) + args = parser.parse_args( + [ + "extract", + "-o", + "sonarqube", + "-dp", + "/path/to/data", + "-ep", + "/path/to/extracted", + "-le", + "py", + "-rep", + "/path/to/repo", + ] + ) assert args.func == command_extract - assert args.output_origin == 'sonarqube' - assert args.data_path == Path('/path/to/data') - assert args.extracted_path == Path('/path/to/extracted') - assert args.language_extension == 'py' - assert args.repository_path == '/path/to/repo' + assert args.output_origin == "sonarqube" + assert args.data_path == Path("/path/to/data") + assert args.extracted_path == Path("/path/to/extracted") + assert args.language_extension == "py" + assert args.repository_path == "/path/to/repo" def test_parser_calculate(): parser = create_parser() - args = parser.parse_args(['calculate', 'all', '-ep', '/path/to/extracted', '-cp', '/path/to/config', '-o', 'csv']) + args = parser.parse_args( + [ + "calculate", + "all", + "-ep", + "/path/to/extracted", + "-cp", + "/path/to/config", + "-o", + "csv", + ] + ) assert args.func == command_calculate - assert args.all == 'all' - assert args.extracted_path == Path('/path/to/extracted') - assert args.config_path == Path('/path/to/config') - assert args.output_format == 'csv' + assert args.all == "all" + assert args.extracted_path == Path("/path/to/extracted") + assert args.config_path == Path("/path/to/config") + assert args.output_format == "csv" From ffcd3ce9ea7c72d2abff0f1bbe6cda6c0c988601 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Sun, 28 Jul 2024 20:08:17 -0300 Subject: [PATCH 10/52] Fix: adjust read planned file function name --- src/cli/commands/cmd_norm_diff.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 086b750f..f9c5684c 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -7,19 +7,19 @@ logger = logging.getLogger("msgram") -def read_json_file(file_path, sort_key=None): +def read_planned_file(file_path, sort_key=None): try: json_data = open_json_file(file_path) return sorted(json_data, key=lambda x: x[sort_key]) if sort_key else json_data except exceptions.MeasureSoftGramCLIException as e: - print_error(f"[red]Error reading file {file_path}: {e}\n") + print_error(f"[red]Error reading planned file in {file_path}: {e}\n") print_rule() exit(1) -def read_calculated_file(extracted_calculation): +def read_calculated_file(file_path): try: calculated_data = [] - json = open_json_file(extracted_calculation) + json = open_json_file(file_path) for item in json: characteristics = sorted(item["characteristics"], key=lambda x: x["key"]) repository = item["repository"][0]["value"] @@ -35,7 +35,7 @@ def read_calculated_file(extracted_calculation): return calculated_data except exceptions.MeasureSoftGramCLIException as e: print_error( - f"[red]Error reading calculated file in {extracted_calculation}: {e}\n" + f"[red]Error reading calculated file in {file_path}: {e}\n" ) print_rule() exit(1) @@ -49,7 +49,7 @@ def command_norm_diff(args): print_error(f"KeyError: args[{e}] - non-existent parameters") exit(1) - planned_data = read_json_file(planned_path, sort_key="key") + planned_data = read_planned_file(planned_path, sort_key="key") calculated_data = read_calculated_file(calculated_path) planned_vector, calculated_vector = extract_values(planned_data, calculated_data) @@ -58,7 +58,6 @@ def command_norm_diff(args): print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]") print_info("[#A9A9A9]For more detailed informations use 'diff' command.[/]") print(f"Norm Diff: {norm_diff_value}") - print_rule() def extract_values(planned_data, calculated_data): From a78a8919f870eb2935112532a98b4df66d6d04f9 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Sun, 28 Jul 2024 20:10:40 -0300 Subject: [PATCH 11/52] Test: add tests to test norm diff command --- .gitignore | 2 + tests/unit/data/calculated.json | 52 +++++++++++ tests/unit/data/missmatch-planned.json | 14 +++ tests/unit/data/planned.json | 10 +++ tests/unit/test_norm_diff.py | 119 +++++++++++++++++++++++++ 5 files changed, 197 insertions(+) create mode 100644 tests/unit/data/calculated.json create mode 100644 tests/unit/data/missmatch-planned.json create mode 100644 tests/unit/data/planned.json create mode 100644 tests/unit/test_norm_diff.py diff --git a/.gitignore b/.gitignore index a765f380..b4c8550e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ __pycache__/ venv/ ENV/ .tox +msgram-cli-venv +.python-version # Distribution / packaging .Python diff --git a/tests/unit/data/calculated.json b/tests/unit/data/calculated.json new file mode 100644 index 00000000..628dd3fb --- /dev/null +++ b/tests/unit/data/calculated.json @@ -0,0 +1,52 @@ +[ + { + "repository": [ + { + "key": "repository", + "value": "Example Repository" + } + ], + "version": [ + { + "key": "version", + "value": "27-07-2024-21-40" + } + ], + "measures": [ + { + "key": "first_measure", + "value": 1.0 + }, + { + "key": "second_measure", + "value": 0.9996066627522133 + } + ], + "subcharacteristics": [ + { + "key": "first_subcharacteristics", + "value": 0.8421061048464034 + }, + { + "key": "second_subcharacteristics", + "value": 0.6415437113263573 + } + ], + "characteristics": [ + { + "key": "first_characteristics", + "value": 0.8421061048464034 + }, + { + "key": "second_characteristics", + "value": 0.6415437113263573 + } + ], + "tsqmi": [ + { + "key": "tsqmi", + "value": 0.7485723162667646 + } + ] + } +] \ No newline at end of file diff --git a/tests/unit/data/missmatch-planned.json b/tests/unit/data/missmatch-planned.json new file mode 100644 index 00000000..63501135 --- /dev/null +++ b/tests/unit/data/missmatch-planned.json @@ -0,0 +1,14 @@ +[ + { + "key": "first_characteristics", + "value": 0.95 + }, + { + "key": "second_characteristics ", + "value": 0.95 + }, + { + "key": "third_characteristics ", + "value": 0.95 + } + ] \ No newline at end of file diff --git a/tests/unit/data/planned.json b/tests/unit/data/planned.json new file mode 100644 index 00000000..52587df4 --- /dev/null +++ b/tests/unit/data/planned.json @@ -0,0 +1,10 @@ +[ + { + "key": "first_characteristics", + "value": 0.95 + }, + { + "key": "second_characteristics ", + "value": 0.95 + } + ] \ No newline at end of file diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py new file mode 100644 index 00000000..2e41dee7 --- /dev/null +++ b/tests/unit/test_norm_diff.py @@ -0,0 +1,119 @@ +from io import StringIO +from pathlib import Path +import shutil +import sys +import tempfile + +import pytest +from src.cli.commands.cmd_norm_diff import command_norm_diff + +def test_norm_diff(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + command_norm_diff({ + "planned_path": Path(config_dirpath) / "planned.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + }) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert "Norm diff calculation performed successfully!" in output + assert "For more detailed informations use 'diff' command." in output + + norm_diff_value = float(output.split("Norm Diff:")[1].split("\n")[0].strip()) + assert norm_diff_value == 0.24323122001478284 + +def test_missing_args(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff({ + "planned_path": Path(config_dirpath) / "planned.json" + }) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "non-existent parameters" in output + +def test_invalid_calculated_file(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff({ + "planned_path": Path(config_dirpath) / "planned.json", + "calculated_path": Path(config_dirpath) / "invalid.json", + }) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "Error reading calculate" in output + +def test_invalid_planned_file(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff({ + "planned_path": Path(config_dirpath) / "invalid.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + }) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "Error reading planned" in output + +def test_missmatch_values(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/missmatch-planned.json", f"{config_dirpath}/missmatch-planned.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff({ + "planned_path": Path(config_dirpath) / "missmatch-planned.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + }) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "Error extracting values" in output \ No newline at end of file From d3964dd23ab7fbf6ffcbf817af00c0dcf56be24a Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Sun, 28 Jul 2024 21:01:22 -0300 Subject: [PATCH 12/52] Fix: adjust lint of cmd norm diff files --- src/cli/aggregate_metrics.py | 12 +++--- src/cli/commands/cmd_calculate.py | 23 +++++++---- src/cli/commands/cmd_norm_diff.py | 25 +++++++----- src/cli/parsers.py | 4 +- tests/unit/test_aggregate.py | 29 +++++++++---- tests/unit/test_calculate.py | 44 ++++++++++---------- tests/unit/test_norm_diff.py | 56 ++++++++++++++++---------- tests/unit/test_parser.py | 67 +++++++++++++++++++------------ 8 files changed, 158 insertions(+), 102 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index f35fc282..19d76793 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -127,7 +127,9 @@ def process_github_metrics(folder_path, github_files, metrics): github_file_content = read_msgram(github_file_path) if not github_file_content: - print_error(f"> [red] Error to read github metrics in: {github_file_path}\n") + print_error( + f"> [red] Error to read github metrics in: {github_file_path}\n" + ) continue github_key = next(iter(github_file_content.keys() - metrics["sonar"]), "") @@ -155,9 +157,9 @@ def process_github_metrics(folder_path, github_files, metrics): def find_common_part(sonar_filename, github_result): sonar_filename_root, _ = os.path.splitext(sonar_filename) - sonar_parts = sonar_filename_root.split('-') + sonar_parts = sonar_filename_root.split("-") if len(sonar_parts) >= 7: - sonar_key = '-'.join(sonar_parts[:7]) + sonar_key = "-".join(sonar_parts[:7]) for github_filename, github_metrics in github_result: github_filename_root, _ = os.path.splitext(github_filename) @@ -187,9 +189,7 @@ def aggregate_metrics(folder_path, config: json): config_has_github = should_process_github_metrics(config) if config_has_github: - github_result = process_github_metrics( - folder_path, github_files, metrics - ) + github_result = process_github_metrics(folder_path, github_files, metrics) if not github_result: print_error("> [red]Error: Unexpected result from process_github_metrics") diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 1ecc4579..8935949c 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -118,12 +118,14 @@ def calculate_all(json_data, file_name, config): "repository": [{"key": "repository", "value": repository}], "version": [{"key": "version", "value": version}] if version else [], "measures": data_measures["measures"] if data_measures else [], - "subcharacteristics": data_subcharacteristics["subcharacteristics"] - if data_subcharacteristics - else [], - "characteristics": data_characteristics["characteristics"] - if data_characteristics - else [], + "subcharacteristics": ( + data_subcharacteristics["subcharacteristics"] + if data_subcharacteristics + else [] + ), + "characteristics": ( + data_characteristics["characteristics"] if data_characteristics else [] + ), "tsqmi": data_tsqmi["tsqmi"] if data_tsqmi else [], } @@ -186,12 +188,17 @@ def show_tree(data_calculated, pre_config): for subchar_c in char_c["subcharacteristics"]: subchar = get_obj_by_element(subcharacteristics, "key", subchar_c["key"]) if subchar: - sub_char_tree = Node(f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree) + sub_char_tree = Node( + f"[blue]{subchar['key']} {subchar['value']}", parent=char_tree + ) for measure_c in subchar_c["measures"]: measure = get_obj_by_element(measures, "key", measure_c["key"]) if measure: - Node(f"[yellow]{measure['key']} {measure['value']}", parent=sub_char_tree) + Node( + f"[yellow]{measure['key']} {measure['value']}", + parent=sub_char_tree, + ) for pre, fill, node in RenderTree(tsqmi_tree): print(f"{pre}{node.name}") diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index f9c5684c..83979041 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -7,6 +7,7 @@ logger = logging.getLogger("msgram") + def read_planned_file(file_path, sort_key=None): try: json_data = open_json_file(file_path) @@ -16,6 +17,7 @@ def read_planned_file(file_path, sort_key=None): print_rule() exit(1) + def read_calculated_file(file_path): try: calculated_data = [] @@ -34,12 +36,11 @@ def read_calculated_file(file_path): return calculated_data except exceptions.MeasureSoftGramCLIException as e: - print_error( - f"[red]Error reading calculated file in {file_path}: {e}\n" - ) + print_error(f"[red]Error reading calculated file in {file_path}: {e}\n") print_rule() exit(1) + def command_norm_diff(args): try: planned_path = args["planned_path"] @@ -60,25 +61,27 @@ def command_norm_diff(args): print(f"Norm Diff: {norm_diff_value}") print_rule() + def extract_values(planned_data, calculated_data): try: planned = planned_data calculated = [] for item in calculated_data: - for characteristic in item['characteristics']: - calculated.append({'key': characteristic['key'], 'value': characteristic['value']}) - + for characteristic in item["characteristics"]: + calculated.append( + {"key": characteristic["key"], "value": characteristic["value"]} + ) - planned_keys = {item['key'].strip() for item in planned} - calculated_keys = {item['key'].strip() for item in calculated} + planned_keys = {item["key"].strip() for item in planned} + calculated_keys = {item["key"].strip() for item in calculated} if planned_keys != calculated_keys: raise exceptions.MeasureSoftGramCLIException( "Planned and calculated files have different characteristics" ) - - planned_dict = {item['key'].strip(): item['value'] for item in planned} - calculated_dict = {item['key'].strip(): item['value'] for item in calculated} + + planned_dict = {item["key"].strip(): item["value"] for item in planned} + calculated_dict = {item["key"].strip(): item["value"] for item in calculated} planned_values = [planned_dict[key] for key in planned_keys] calculated_values = [calculated_dict[key] for key in planned_keys] diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 3e2780af..b1a4d73f 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -173,6 +173,8 @@ def create_parser(): help="Path to the json with the calculated metrics.", ) - parser_norm_diff.set_defaults(func=command_norm_diff) # function command list config + parser_norm_diff.set_defaults( + func=command_norm_diff + ) # function command list config return parser diff --git a/tests/unit/test_aggregate.py b/tests/unit/test_aggregate.py index 17110739..1e05c642 100644 --- a/tests/unit/test_aggregate.py +++ b/tests/unit/test_aggregate.py @@ -13,7 +13,7 @@ process_github_metrics, process_sonar_metrics, aggregate_metrics, - find_common_part + find_common_part, ) @@ -93,7 +93,9 @@ def test_process_github_metrics(): metrics = {"sonar": ["some_metric"], "github": ["resolved_issues", "total_issues"]} - result = process_github_metrics(folder_path, [github_file_name, github_file_name], metrics) + result = process_github_metrics( + folder_path, [github_file_name, github_file_name], metrics + ) expected_result = ( github_file_name, @@ -152,10 +154,12 @@ def test_aggregate_metrics(): folder_path = temp_dir msgram_file1 = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram", ) msgram_file2 = os.path.join( - folder_path, "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram" + folder_path, + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", ) with open(msgram_file1, "w") as file: @@ -177,7 +181,8 @@ def test_aggregate_metrics(): assert result is True output_file_path = os.path.join( - folder_path, "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics" + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics", ) assert os.path.exists(output_file_path) @@ -200,11 +205,19 @@ def test_aggregate_metrics(): def test_find_common_part(): sonar_filename = "fga-eps-mds-2023-2-MeasureSoftGram-Parser-02-06-2023-21-40-30-develop-extracted" github_files = [ - ("github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", "Metrics1"), - ("github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", "Metrics2") + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", + "Metrics1", + ), + ( + "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", + "Metrics2", + ), ] - with patch("builtins.print"): # Mocking the print function to avoid print statements during testing + with patch( + "builtins.print" + ): # Mocking the print function to avoid print statements during testing result = find_common_part(sonar_filename, github_files) assert result == "Metrics1" diff --git a/tests/unit/test_calculate.py b/tests/unit/test_calculate.py index 0b2bbcbb..36c6228c 100644 --- a/tests/unit/test_calculate.py +++ b/tests/unit/test_calculate.py @@ -23,30 +23,32 @@ def test_show_tree(capfd): data_calculated = { - 'repository': [{'key': 'repository', 'value': 'fga-eps-mds-2022-2-MeasureSoftGram-CLI'}], - 'version': [{'key': 'version', 'value': '01-05-2023-21-40'}], - 'measures': [ - {'key': 'passed_tests', 'value': 1.0}, - {'key': 'test_builds', 'value': 0.9996066627522133}, - {'key': 'test_coverage', 'value': 0.40234848484848484}, - {'key': 'non_complex_file_density', 'value': 0.44347274991556906}, - {'key': 'commented_file_density', 'value': 0.04318181818181818}, - {'key': 'duplication_absence', 'value': 1.0}, - {'key': 'team_throughput', 'value': 0.6969696969696971}, - {'key': 'ci_feedback_time', 'value': 0.06117908787541713} + "repository": [ + {"key": "repository", "value": "fga-eps-mds-2022-2-MeasureSoftGram-CLI"} + ], + "version": [{"key": "version", "value": "01-05-2023-21-40"}], + "measures": [ + {"key": "passed_tests", "value": 1.0}, + {"key": "test_builds", "value": 0.9996066627522133}, + {"key": "test_coverage", "value": 0.40234848484848484}, + {"key": "non_complex_file_density", "value": 0.44347274991556906}, + {"key": "commented_file_density", "value": 0.04318181818181818}, + {"key": "duplication_absence", "value": 1.0}, + {"key": "team_throughput", "value": 0.6969696969696971}, + {"key": "ci_feedback_time", "value": 0.06117908787541713}, ], - 'subcharacteristics': [ - {'key': 'testing_status', 'value': 0.8421061048464034}, - {'key': 'maturity', 'value': 0.06117908787541713}, - {'key': 'modifiability', 'value': 0.6415437113263573}, - {'key': 'functional_completeness', 'value': 0.6969696969696971} + "subcharacteristics": [ + {"key": "testing_status", "value": 0.8421061048464034}, + {"key": "maturity", "value": 0.06117908787541713}, + {"key": "modifiability", "value": 0.6415437113263573}, + {"key": "functional_completeness", "value": 0.6969696969696971}, ], - 'characteristics': [ - {'key': 'reliability', 'value': 0.5970282960684735}, - {'key': 'maintainability', 'value': 0.6415437113263573}, - {'key': 'functional_suitability', 'value': 0.6969696969696971} + "characteristics": [ + {"key": "reliability", "value": 0.5970282960684735}, + {"key": "maintainability", "value": 0.6415437113263573}, + {"key": "functional_suitability", "value": 0.6969696969696971}, ], - 'tsqmi': [{'key': 'tsqmi', 'value': 0.6455181338484177}] + "tsqmi": [{"key": "tsqmi", "value": 0.6455181338484177}], } expected_output = ( diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index 2e41dee7..29f24918 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -7,6 +7,7 @@ import pytest from src.cli.commands.cmd_norm_diff import command_norm_diff + def test_norm_diff(): config_dirpath = tempfile.mkdtemp() @@ -16,10 +17,12 @@ def test_norm_diff(): shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") - command_norm_diff({ - "planned_path": Path(config_dirpath) / "planned.json", - "calculated_path": Path(config_dirpath) / "calculated.json", - }) + command_norm_diff( + { + "planned_path": Path(config_dirpath) / "planned.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + } + ) sys.stdout = sys.__stdout__ @@ -31,6 +34,7 @@ def test_norm_diff(): norm_diff_value = float(output.split("Norm Diff:")[1].split("\n")[0].strip()) assert norm_diff_value == 0.24323122001478284 + def test_missing_args(): config_dirpath = tempfile.mkdtemp() @@ -41,9 +45,7 @@ def test_missing_args(): shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: - command_norm_diff({ - "planned_path": Path(config_dirpath) / "planned.json" - }) + command_norm_diff({"planned_path": Path(config_dirpath) / "planned.json"}) sys.stdout = sys.__stdout__ @@ -52,6 +54,7 @@ def test_missing_args(): assert excinfo.value.code == 1 assert "non-existent parameters" in output + def test_invalid_calculated_file(): config_dirpath = tempfile.mkdtemp() @@ -62,10 +65,12 @@ def test_invalid_calculated_file(): shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: - command_norm_diff({ - "planned_path": Path(config_dirpath) / "planned.json", - "calculated_path": Path(config_dirpath) / "invalid.json", - }) + command_norm_diff( + { + "planned_path": Path(config_dirpath) / "planned.json", + "calculated_path": Path(config_dirpath) / "invalid.json", + } + ) sys.stdout = sys.__stdout__ @@ -74,6 +79,7 @@ def test_invalid_calculated_file(): assert excinfo.value.code == 1 assert "Error reading calculate" in output + def test_invalid_planned_file(): config_dirpath = tempfile.mkdtemp() @@ -84,10 +90,12 @@ def test_invalid_planned_file(): shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: - command_norm_diff({ - "planned_path": Path(config_dirpath) / "invalid.json", - "calculated_path": Path(config_dirpath) / "calculated.json", - }) + command_norm_diff( + { + "planned_path": Path(config_dirpath) / "invalid.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + } + ) sys.stdout = sys.__stdout__ @@ -96,24 +104,30 @@ def test_invalid_planned_file(): assert excinfo.value.code == 1 assert "Error reading planned" in output + def test_missmatch_values(): config_dirpath = tempfile.mkdtemp() captured_output = StringIO() sys.stdout = captured_output - shutil.copy("tests/unit/data/missmatch-planned.json", f"{config_dirpath}/missmatch-planned.json") + shutil.copy( + "tests/unit/data/missmatch-planned.json", + f"{config_dirpath}/missmatch-planned.json", + ) shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: - command_norm_diff({ - "planned_path": Path(config_dirpath) / "missmatch-planned.json", - "calculated_path": Path(config_dirpath) / "calculated.json", - }) + command_norm_diff( + { + "planned_path": Path(config_dirpath) / "missmatch-planned.json", + "calculated_path": Path(config_dirpath) / "calculated.json", + } + ) sys.stdout = sys.__stdout__ output = captured_output.getvalue() assert excinfo.value.code == 1 - assert "Error extracting values" in output \ No newline at end of file + assert "Error extracting values" in output diff --git a/tests/unit/test_parser.py b/tests/unit/test_parser.py index 5c0894ab..56320009 100644 --- a/tests/unit/test_parser.py +++ b/tests/unit/test_parser.py @@ -25,46 +25,61 @@ def mock_command_list(args): def test_parser_init(): parser = create_parser() - args = parser.parse_args(['init', '-cp', '/path/to/config']) + args = parser.parse_args(["init", "-cp", "/path/to/config"]) assert args.func == command_init - assert args.config_path == Path('/path/to/config') + assert args.config_path == Path("/path/to/config") def test_parser_list(): parser = create_parser() - args = parser.parse_args(['list', '-cp', '/path/to/config', 'all']) + args = parser.parse_args(["list", "-cp", "/path/to/config", "all"]) assert args.func == command_list - assert args.config_path == Path('/path/to/config') - assert args.all == 'all' + assert args.config_path == Path("/path/to/config") + assert args.all == "all" def test_parser_extract(): parser = create_parser() - args = parser.parse_args(['extract', - '-o', - 'sonarqube', - '-dp', - '/path/to/data', - '-ep', - '/path/to/extracted', - '-le', - 'py', - '-rep', - '/path/to/repo']) + args = parser.parse_args( + [ + "extract", + "-o", + "sonarqube", + "-dp", + "/path/to/data", + "-ep", + "/path/to/extracted", + "-le", + "py", + "-rep", + "/path/to/repo", + ] + ) assert args.func == command_extract - assert args.output_origin == 'sonarqube' - assert args.data_path == Path('/path/to/data') - assert args.extracted_path == Path('/path/to/extracted') - assert args.language_extension == 'py' - assert args.repository_path == '/path/to/repo' + assert args.output_origin == "sonarqube" + assert args.data_path == Path("/path/to/data") + assert args.extracted_path == Path("/path/to/extracted") + assert args.language_extension == "py" + assert args.repository_path == "/path/to/repo" def test_parser_calculate(): parser = create_parser() - args = parser.parse_args(['calculate', 'all', '-ep', '/path/to/extracted', '-cp', '/path/to/config', '-o', 'csv']) + args = parser.parse_args( + [ + "calculate", + "all", + "-ep", + "/path/to/extracted", + "-cp", + "/path/to/config", + "-o", + "csv", + ] + ) assert args.func == command_calculate - assert args.all == 'all' - assert args.extracted_path == Path('/path/to/extracted') - assert args.config_path == Path('/path/to/config') - assert args.output_format == 'csv' + assert args.all == "all" + assert args.extracted_path == Path("/path/to/extracted") + assert args.config_path == Path("/path/to/config") + assert args.output_format == "csv" From 9c9e39db74b70546b83087973297647817adb512 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 28 Jul 2024 22:15:05 -0300 Subject: [PATCH 13/52] =?UTF-8?q?BUG006=20-=20Corre=C3=A7=C3=A3o=20de=20te?= =?UTF-8?q?stes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_extract.py | 8 ++++---- src/cli/parsers.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 5849d913..1330cc5e 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -56,7 +56,9 @@ def command_extract(args): print_warn(f"KeyError: args[{e}] - non-existent parameters") exit(1) - if args["label"] and output_origin == "sonarqube": + label = args.get("label", None) + + if label is not None and output_origin == "sonarqube": logger.error( 'Error: The parameter "-lb" must accompany a github repository output' ) @@ -80,9 +82,7 @@ def command_extract(args): parser = GenericParser() if repository_path and output_origin == "github": - filters = { - "labels": args["label"] if args["label"] else "US,User Story,User Stories" - } + filters = {"labels": label if label else "US,User Story,User Stories"} result = parser.parse( input_value=repository_path, type_input=output_origin, filters=filters ) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 2e41a882..c4d30167 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -99,7 +99,6 @@ def create_parser(): "-lb", "--label", type=str, - default="US,User Story,User Stories", help=( "Selected label name for extracted user story issues. Format 'XX YY'" + " Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" From 74218e64d76cdebb19f7b395dbd063bd60a39e52 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sun, 28 Jul 2024 22:45:59 -0300 Subject: [PATCH 14/52] =?UTF-8?q?BUG006=20-=20Corrigindo=20texto=20de=20in?= =?UTF-8?q?forma=C3=A7=C3=A3o=20do=20'-lb'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index c4d30167..4d00fab8 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -100,7 +100,7 @@ def create_parser(): "--label", type=str, help=( - "Selected label name for extracted user story issues. Format 'XX YY'" + "Selected label name for extracted user story issues. Format 'XX YY'." + " Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" ), ) From 45a4fb988ba438a224e000f7df6aa574524fa98c Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Mon, 29 Jul 2024 00:48:13 -0300 Subject: [PATCH 15/52] BUG007 - Corrigir modo de consulta de workflows para CI_feedback_time --- .gitignore | 6 ++++++ src/cli/commands/cmd_extract.py | 13 ++++++++++++- src/cli/parsers.py | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b4c8550e..830567cf 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,9 @@ analytics-raw-data/ **/*.log setup.py + +# Vim +*.swp + +# ctags +tags diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 1330cc5e..49b23873 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -57,6 +57,7 @@ def command_extract(args): exit(1) label = args.get("label", None) + workflows = args.get("workflows", None) if label is not None and output_origin == "sonarqube": logger.error( @@ -76,13 +77,23 @@ def command_extract(args): ) sys.exit(1) + if workflows is not None and output_origin == "sonarqube": + logger.error( + 'Error: The parameter "-wf" must accompany a github repository output' + ) + print_warn( + 'Error: The parameter "-wf" must accompany a github repository output' + ) + sys.exit(1) + console = Console() console.clear() print_rule("Extract metrics") parser = GenericParser() if repository_path and output_origin == "github": - filters = {"labels": label if label else "US,User Story,User Stories"} + filters = {"labels": label if label else "US,User Story,User Stories", + "workflows": workflows if workflows else None} result = parser.parse( input_value=repository_path, type_input=output_origin, filters=filters ) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 757dc9a2..76c58c59 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -122,6 +122,13 @@ def create_parser(): help="Path to analysis git repository", ) + parser_extract.add_argument( + "-wf", + "--workflows", + type=list, + help="A list of workflow names to be considered in the ci feedback time calculation", + ) + parser_extract.set_defaults(func=command_extract) # function command extract # =====================================< COMMAND calculate >===================================== From f82114ac1cdd68438dd8523857f6afb89f226771 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 30 Jul 2024 19:20:18 -0300 Subject: [PATCH 16/52] ENH002 - Tratamento do filtro por datas no CLI --- src/cli/commands/cmd_extract.py | 35 +++++++++++++++++++++------------ src/cli/parsers.py | 25 +++++++++++++++-------- src/cli/utils.py | 20 +++++++++++++++++++ 3 files changed, 59 insertions(+), 21 deletions(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 49b23873..8584f580 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -17,6 +17,7 @@ print_panel, print_rule, print_warn, + is_valid_date_range, ) logger = logging.getLogger("msgram") @@ -42,6 +43,17 @@ def get_infos_from_name(filename: str) -> str: return f"{file_name}-extracted.msgram" +def check_error_accompany_github(param, value, output_origin): + if value is not None and output_origin == "sonarqube": + logger.error( + f'Error: The parameter "-{param}" must accompany a github repository output' + ) + print_warn( + f'Error: The parameter "-{param}" must accompany a github repository output' + ) + sys.exit(1) + + def command_extract(args): time_init = perf_counter() try: @@ -58,13 +70,18 @@ def command_extract(args): label = args.get("label", None) workflows = args.get("workflows", None) + filter_date = args.get("filter_date", None) - if label is not None and output_origin == "sonarqube": + check_error_accompany_github("lb", label, output_origin) + check_error_accompany_github("wf", workflows, output_origin) + check_error_accompany_github("fd", filter_date, output_origin) + + if filter_date is not None and not is_valid_date_range(filter_date): logger.error( - 'Error: The parameter "-lb" must accompany a github repository output' + "Error: Range of dates for filter must be in format 'dd/mm/yyyy-dd/mm/yyyy'" ) print_warn( - 'Error: The parameter "-lb" must accompany a github repository output' + "Error: Range of dates for filter must be in format 'dd/mm/yyyy-dd/mm/yyyy'" ) sys.exit(1) @@ -77,15 +94,6 @@ def command_extract(args): ) sys.exit(1) - if workflows is not None and output_origin == "sonarqube": - logger.error( - 'Error: The parameter "-wf" must accompany a github repository output' - ) - print_warn( - 'Error: The parameter "-wf" must accompany a github repository output' - ) - sys.exit(1) - console = Console() console.clear() print_rule("Extract metrics") @@ -93,7 +101,8 @@ def command_extract(args): if repository_path and output_origin == "github": filters = {"labels": label if label else "US,User Story,User Stories", - "workflows": workflows if workflows else None} + "workflows": workflows if workflows else None, + "dates": filter_date if filter_date else None} result = parser.parse( input_value=repository_path, type_input=output_origin, filters=filters ) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 76c58c59..242c9c39 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -103,7 +103,23 @@ def create_parser(): type=str, help=( "Selected label name for extracted user story issues. Format 'XX YY'." - + " Default values, not case sensitive: 'US', 'User Story' or 'User Stories'" + + " Default, not case sensitive: 'US', 'User Story' or 'User Stories'" + ), + ) + + parser_extract.add_argument( + "-wf", + "--workflows", + type=list, + help="Selected workflow name to be considered in the CI Feedback Time extraction. Default: 'build'", + ) + + parser_extract.add_argument( + "-fd", + "--filter_date", + type=str, + help=( + "Filter range of dates considered on extraction, with format 'dd/mm/yyyy-dd/mm/yyyy'" ), ) @@ -122,13 +138,6 @@ def create_parser(): help="Path to analysis git repository", ) - parser_extract.add_argument( - "-wf", - "--workflows", - type=list, - help="A list of workflow names to be considered in the ci feedback time calculation", - ) - parser_extract.set_defaults(func=command_extract) # function command extract # =====================================< COMMAND calculate >===================================== diff --git a/src/cli/utils.py b/src/cli/utils.py index b47e0f20..e3df7fdd 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -1,4 +1,6 @@ import logging +import re +from datetime import datetime from rich import box, print from rich.console import Console @@ -9,6 +11,24 @@ logger = logging.getLogger("msgram") console = Console(highlight=False, soft_wrap=False, width=140) +DATE_PATTERN = r"^\d{2}/\d{2}/\d{4}-\d{2}/\d{2}/\d{4}$" + + +def is_valid_date_range(date): + match = re.match(DATE_PATTERN, date) + if not match: + return False + + d1, m1, y1, d2, m2, y2 = [int(time) for time in re.split(r'[/\-]', date)] + + try: + since = datetime(y1, m1, d1) + until = datetime(y2, m2, d2) + except ValueError: + return False + + return since <= until + def print_info(text: str): """Print an info message.""" From 53d9093edab1c17abe7612ac73a4b011521a89b4 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 30 Jul 2024 23:43:12 -0300 Subject: [PATCH 17/52] =?UTF-8?q?ENH002=20-=20Adi=C3=A7=C3=A3o=20de=20test?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_extract.py | 8 +-- src/cli/utils.py | 2 +- tests/unit/test_extract.py | 92 +++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 4 deletions(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 8584f580..5a81f356 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -100,9 +100,11 @@ def command_extract(args): parser = GenericParser() if repository_path and output_origin == "github": - filters = {"labels": label if label else "US,User Story,User Stories", - "workflows": workflows if workflows else None, - "dates": filter_date if filter_date else None} + filters = { + "labels": label if label else "US,User Story,User Stories", + "workflows": workflows if workflows else None, + "dates": filter_date if filter_date else None, + } result = parser.parse( input_value=repository_path, type_input=output_origin, filters=filters ) diff --git a/src/cli/utils.py b/src/cli/utils.py index e3df7fdd..63f4fc5e 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -19,7 +19,7 @@ def is_valid_date_range(date): if not match: return False - d1, m1, y1, d2, m2, y2 = [int(time) for time in re.split(r'[/\-]', date)] + d1, m1, y1, d2, m2, y2 = [int(time) for time in re.split(r"[/\-]", date)] try: since = datetime(y1, m1, d1) diff --git a/tests/unit/test_extract.py b/tests/unit/test_extract.py index 2af19fee..aa8664ca 100644 --- a/tests/unit/test_extract.py +++ b/tests/unit/test_extract.py @@ -114,6 +114,98 @@ def test_extract_fail_no_dp_or_rep(): ) +def test_extract_fail_sonarqube_wf(): + extract_dirpath = tempfile.mkdtemp() + args = { + "output_origin": "sonarqube", + "language_extension": "py", + "extracted_path": Path(extract_dirpath), + "repository_path": "fga-eps-mds/2023-1-MeasureSoftGram-DOC", + "workflows": "pages build and deployment", + } + + captured_output = StringIO() + sys.stdout = captured_output + with pytest.raises(SystemExit): + command_extract(args) + + sys.stdout = sys.__stdout__ + + assert ( + 'Error: The parameter "-wf" must accompany a github repository output' + in captured_output.getvalue() + ) + + +def test_extract_fail_sonarqube_lb(): + extract_dirpath = tempfile.mkdtemp() + args = { + "output_origin": "sonarqube", + "language_extension": "py", + "extracted_path": Path(extract_dirpath), + "repository_path": "fga-eps-mds/2023-1-MeasureSoftGram-DOC", + "label": "US", + } + + captured_output = StringIO() + sys.stdout = captured_output + with pytest.raises(SystemExit): + command_extract(args) + + sys.stdout = sys.__stdout__ + + assert ( + 'Error: The parameter "-lb" must accompany a github repository output' + in captured_output.getvalue() + ) + + +def test_extract_fail_sonarqube_fd(): + extract_dirpath = tempfile.mkdtemp() + args = { + "output_origin": "sonarqube", + "language_extension": "py", + "extracted_path": Path(extract_dirpath), + "repository_path": "fga-eps-mds/2023-1-MeasureSoftGram-DOC", + "filter_date": "20/06/2023-15/07/2023", + } + + captured_output = StringIO() + sys.stdout = captured_output + with pytest.raises(SystemExit): + command_extract(args) + + sys.stdout = sys.__stdout__ + + assert ( + 'Error: The parameter "-fd" must accompany a github repository output' + in captured_output.getvalue() + ) + + +def test_extract_fail_date_format(): + extract_dirpath = tempfile.mkdtemp() + args = { + "output_origin": "github", + "language_extension": "py", + "extracted_path": Path(extract_dirpath), + "repository_path": "fga-eps-mds/2023-1-MeasureSoftGram-DOC", + "filter_date": "20/06/2023-15/07/2021", + } + + captured_output = StringIO() + sys.stdout = captured_output + with pytest.raises(SystemExit): + command_extract(args) + + sys.stdout = sys.__stdout__ + + assert ( + "Error: Range of dates for filter must be in format 'dd/mm/yyyy-dd/mm/yyyy'" + in captured_output.getvalue() + ) + + def test_extract_directory_not_exist(): args = { "output_origin": "sonarqube", From 50af65a0c2617b6e62ed54ebf6e334ad1a02e5a3 Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Thu, 1 Aug 2024 14:11:38 -0300 Subject: [PATCH 18/52] Update default workflow --- src/cli/commands/cmd_extract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 5a81f356..cd273338 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows if workflows else None, + "workflows": workflows if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( From f8ba4e98abff36442cc70450a62f1ed7c093537f Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 1 Aug 2024 15:21:50 -0300 Subject: [PATCH 19/52] =?UTF-8?q?BUG008=20-=20Inicio=20de=20implementa?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20separa=C3=A7=C3=A3o=20do=20calculate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/aggregate_metrics.py | 14 +++++++++----- src/cli/commands/cmd_calculate.py | 12 ++++++++---- src/cli/parsers.py | 9 +++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index 19d76793..cf1b746b 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -170,7 +170,7 @@ def find_common_part(sonar_filename, github_result): return False -def aggregate_metrics(folder_path, config: json): +def aggregate_metrics(input_format, folder_path, config: json): msgram_files = list_msgram_files(folder_path) if not msgram_files: @@ -188,7 +188,7 @@ def aggregate_metrics(folder_path, config: json): config_has_github = should_process_github_metrics(config) - if config_has_github: + if config_has_github and input_format == "github": github_result = process_github_metrics(folder_path, github_files, metrics) if not github_result: @@ -196,8 +196,7 @@ def aggregate_metrics(folder_path, config: json): return False have_metrics = True - - if should_process_sonar_metrics(config): + if should_process_sonar_metrics(config) and input_format == "sonarqube": sonar_result = process_sonar_metrics(folder_path, msgram_files, github_files) if not sonar_result: @@ -206,10 +205,15 @@ def aggregate_metrics(folder_path, config: json): have_metrics = True + print(len(github_result), len(sonar_result)) + if not have_metrics: - print_error("> [red]Error: No metrics where found in the .msgram files") + print_error(f"> [red]Error: No metrics where found in the .msgram files from the type: {input_format}") return False + + + for sonar_filename, file_content in sonar_result: github_metrics = find_common_part(sonar_filename, github_result) diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 8935949c..4d18b670 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -18,7 +18,7 @@ from src.cli.utils import print_error, print_info, print_panel, print_rule, print_table from src.cli.aggregate_metrics import aggregate_metrics from src.cli.exceptions import exceptions -from src.config.settings import DEFAULT_CONFIG_PATH, FILE_CONFIG +from src.config.settings import DEFAULT_CONFIG_PATH, FILE_CONFIG_GITHUB, FILE_CONFIG_SONARQUBE logger = logging.getLogger("msgram") @@ -34,11 +34,14 @@ def read_config_file(config_path): exit(1) -def calculate_metrics(extracted_path, config): +def calculate_metrics(input_format, extracted_path, config): data_calculated = [] + print('teste: ', extracted_path) + print('format: ', input_format) + if not extracted_path.is_file(): - if not aggregate_metrics(extracted_path, config): + if not aggregate_metrics(input_format, extracted_path, config): print_error( "> [red] Failed to aggregate metrics, calculate was not performed. \n" ) @@ -63,6 +66,7 @@ def calculate_metrics(extracted_path, config): def command_calculate(args): try: output_format: str = args["output_format"] + input_format: str = args["input_format"] config_path = args["config_path"] extracted_path = args["extracted_path"] @@ -80,7 +84,7 @@ def command_calculate(args): print_info("\n> [blue] Reading extracted files:[/]") - data_calculated, success = calculate_metrics(extracted_path, config) + data_calculated, success = calculate_metrics(input_format, extracted_path, config) if success: print_info("\n[#A9A9A9]All calculations performed[/] successfully!") diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 242c9c39..5b6e3825 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -170,6 +170,15 @@ def create_parser(): help="Path to the config directory", ) + parser_calculate.add_argument( + "-in", + "--input_format", + type=str, + choices=AVAILABLE_IMPORTS, + default="sonarqube", + help=("The type of the input (extracted) values is:".join(AVAILABLE_IMPORTS)), + ) + parser_calculate.add_argument( "-o", "--output_format", From 925cfb18d2a37c8acd0256d6148446b9933b9e19 Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Thu, 1 Aug 2024 22:15:29 -0300 Subject: [PATCH 20/52] Fix workflow input type --- src/cli/commands/cmd_extract.py | 2 +- src/cli/parsers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index cd273338..2e6128cc 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows if workflows else "build", + "workflows": workflows if workflows.split(',') else "build", "dates": filter_date if filter_date else None, } result = parser.parse( diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 242c9c39..253231cb 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -110,7 +110,7 @@ def create_parser(): parser_extract.add_argument( "-wf", "--workflows", - type=list, + type=str, help="Selected workflow name to be considered in the CI Feedback Time extraction. Default: 'build'", ) From 8d0bd85f496eab0687e5d454c48453d97cb49a5d Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Thu, 1 Aug 2024 22:16:31 -0300 Subject: [PATCH 21/52] Update dependencies and project version to v3.2.0 --- pyproject.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90537f71..3202db9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "msgram" -version = "3.1.9" +version = "3.2.0" description = "The msgram CLI is a command-line interface to use MeasureSoftGram software" readme = "README.md" authors = [ @@ -20,20 +20,20 @@ classifiers = [ "Topic :: Utilities", ] keywords = ["core", "measures", "quality", "algebraic model"] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ - "requests==2.28.1", + "requests~=2.32.3", "pytz", "typing~=3.7.4.3", - "tabulate==0.8.10", - "termcolor==1.1.0", - "pandas~=2.0.0", - "setuptools~=60.2.0", + "tabulate~=0.9.0", + "termcolor~=2.4.0", + "pandas~=2.2.2", + "setuptools~=72.1.0", "python-dotenv", "rich", - "validators==0.20.0", - "msgram-core==1.4.5", - "msgram-parser==1.1.3", + "validators~=0.33.0", + "msgram-core~=1.4.6", + "msgram-parser~=1.2.1", "anytree" ] From 0b5028c77a92e550959f059e6525bfb9d2e9dd5f Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Thu, 1 Aug 2024 22:17:32 -0300 Subject: [PATCH 22/52] Enable publish by tags --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 7feede77..bed0676f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -33,5 +33,5 @@ jobs: run: python -m twine upload -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} --repository testpypi dist/* - name: Publish package on pypi - #if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* From 75d6663e7df998654de66cbb66dacb8f3caf4976 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 1 Aug 2024 23:37:26 -0300 Subject: [PATCH 23/52] =?UTF-8?q?bug(calculate):=20separa=C3=A7=C3=A3o=20d?= =?UTF-8?q?a=20agrega=C3=A7=C3=A3o=20de=20m=C3=A9tricas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/aggregate_metrics.py | 148 +++++++----------------------- src/cli/commands/cmd_calculate.py | 10 +- src/config/settings.py | 2 + 3 files changed, 42 insertions(+), 118 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index cf1b746b..18be259b 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -24,7 +24,7 @@ ] measures = {} -measures["sonar"] = [ +measures["sonarqube"] = [ "passed_tests", "test_builds", "test_errors", @@ -37,22 +37,13 @@ measures["github"] = ["team_throughput", "ci_feedback_time"] -def should_process_sonar_metrics(config): +def should_process_metrics(input_format, config): for characteristic in config.get("characteristics", []): for subcharacteristic in characteristic.get("subcharacteristics", []): for measure in subcharacteristic.get("measures", []): - if measure.get("key") in measures["sonar"]: - return True - return False - - -def should_process_github_metrics(config): - for characteristic in config.get("characteristics", []): - for subcharacteristic in characteristic.get("subcharacteristics", []): - for measure in subcharacteristic.get("measures", []): - if measure.get("key") in measures["github"]: - return True - return False + if measure.get("key") not in measures[input_format]: + return False + return True def read_msgram(file_path): @@ -96,80 +87,22 @@ def save_metrics(file_name, metrics): print_info(f"> [blue] Metrics saved to: {output_file_path}\n") -def process_sonar_metrics(folder_path, msgram_files, github_files): +def process_metrics(folder_path, msgram_files): processed_files = [] for file in msgram_files: - if file not in github_files: - print_info(f"> [blue] Processing {file}") - sonar_metrics_dict = read_msgram(os.path.join(folder_path, file)) + print_info(f"> [blue] Processing {file}") + metrics_dict = read_msgram(os.path.join(folder_path, file)) - if not sonar_metrics_dict: - print_error(f"> [red] Error to read sonar metrics in: {folder_path}\n") - return False + if not metrics_dict: + print_error(f"> [red] Error to read metrics in: {folder_path}\n") + return False - processed_files.append((file, sonar_metrics_dict)) + processed_files.append((file, metrics_dict)) return processed_files -def process_github_metrics(folder_path, github_files, metrics): - if not github_files: - print_error(f"> [red] GitHub files not found in the directory: {folder_path}\n") - return False - - print_info(f"> [blue] GitHub metrics found in: {folder_path}\n") - - github_metrics_list = [] - - for github_file_name in github_files: - github_file_path = os.path.join(folder_path, github_file_name) - github_file_content = read_msgram(github_file_path) - - if not github_file_content: - print_error( - f"> [red] Error to read github metrics in: {github_file_path}\n" - ) - continue - - github_key = next(iter(github_file_content.keys() - metrics["sonar"]), "") - - github_metrics = [ - { - "metric": metric, - "value": next( - ( - m["value"] - for m in github_file_content[github_key] - if m["metric"] == metric - ), - None, - ), - } - for metric in metrics["github"] - ] - - github_metrics_list.append((github_file_name, github_metrics)) - - return github_metrics_list - - -def find_common_part(sonar_filename, github_result): - sonar_filename_root, _ = os.path.splitext(sonar_filename) - - sonar_parts = sonar_filename_root.split("-") - if len(sonar_parts) >= 7: - sonar_key = "-".join(sonar_parts[:7]) - - for github_filename, github_metrics in github_result: - github_filename_root, _ = os.path.splitext(github_filename) - - if sonar_key in github_filename_root: - return github_metrics - - return False - - def aggregate_metrics(input_format, folder_path, config: json): msgram_files = list_msgram_files(folder_path) @@ -178,56 +111,43 @@ def aggregate_metrics(input_format, folder_path, config: json): return False github_files = [file for file in msgram_files if file.startswith("github_")] - + sonar_files = [file for file in msgram_files if file not in github_files] file_content = {} - sonar_result = [] - github_result = [] + result = [] have_metrics = False - config_has_github = should_process_github_metrics(config) + if input_format == "github": + if should_process_metrics(input_format, config): + result = process_metrics(folder_path, github_files) - if config_has_github and input_format == "github": - github_result = process_github_metrics(folder_path, github_files, metrics) + if not result: + print_error("> [red]Error: Unexpected result from process_github_metrics") + return False - if not github_result: - print_error("> [red]Error: Unexpected result from process_github_metrics") + have_metrics = True + else: + print_error("> [red]Error: Unexpected measures from should_process_metrics") return False + if input_format == "sonarqube": + if should_process_metrics(input_format, config): + result = process_metrics(folder_path, sonar_files) - have_metrics = True - if should_process_sonar_metrics(config) and input_format == "sonarqube": - sonar_result = process_sonar_metrics(folder_path, msgram_files, github_files) + if not result: + print_error("> [red]Error: Unexpected result from process_sonar_metrics") + return False - if not sonar_result: - print_error("> [red]Error: Unexpected result from process_sonar_metrics") + have_metrics = True + else: + print_error("> [red]Error: Unexpected measures from should_process_metrics") return False - have_metrics = True - - print(len(github_result), len(sonar_result)) - if not have_metrics: print_error(f"> [red]Error: No metrics where found in the .msgram files from the type: {input_format}") return False - - - - for sonar_filename, file_content in sonar_result: - github_metrics = find_common_part(sonar_filename, github_result) - - if github_metrics: - file_content["github_metrics"] = github_metrics - elif config_has_github: - print_error( - f"> [red]Error: The configuration provided by the user requires github metrics\n" - f" but there was not found github metrics associated with the file:\n" - f" {sonar_filename}" - ) - - return False - - save_metrics(os.path.join(folder_path, sonar_filename), file_content) + for filename, file_content in result: + save_metrics(os.path.join(folder_path, filename), file_content) return True diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 4d18b670..08fddd7d 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -23,12 +23,13 @@ logger = logging.getLogger("msgram") -def read_config_file(config_path): +def read_config_file(input_format, config_path): try: - return open_json_file(config_path / FILE_CONFIG) + config = FILE_CONFIG_SONARQUBE if input_format == "sonarqube" else FILE_CONFIG_GITHUB + return open_json_file(config_path / config) except exceptions.MeasureSoftGramCLIException as e: print_error( - f"[red]Error reading msgram.json config file in {config_path}: {e}\n" + f"[red]Error reading {config} config file in {config_path}: {e}\n" ) print_rule() exit(1) @@ -47,6 +48,7 @@ def calculate_metrics(input_format, extracted_path, config): ) return data_calculated, False + print('passed\n\n\n') for file, file_name in read_multiple_files(extracted_path, "metrics"): result = calculate_all(file, file_name, config) data_calculated.append(result) @@ -80,7 +82,7 @@ def command_calculate(args): print_rule("Calculate") print_info("> [blue] Reading config file:[/]") - config = read_config_file(config_path) + config = read_config_file(input_format, config_path) print_info("\n> [blue] Reading extracted files:[/]") diff --git a/src/config/settings.py b/src/config/settings.py index 91d86549..5b636562 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -1,5 +1,7 @@ from pathlib import Path +FILE_CONFIG_SONARQUBE = "msgram_sonarqube.json" +FILE_CONFIG_GITHUB = "msgram_github.json" FILE_CONFIG = "msgram.json" DEFAULT_CONFIG_PATH = Path.cwd() / ".msgram" DEFAULT_RAW_DATA_PATH = Path.cwd() / "analytics-raw-data" From 08e747c2316b9e6a8818fb30105c56f23fba43ea Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Fri, 2 Aug 2024 00:41:25 -0300 Subject: [PATCH 24/52] Update requirements.txt --- requirements.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index d51d36ad..ee37da00 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ ###### Install local application in development mode. This will grab install_requires from setup.py. -e . -requests~=2.28.1 -pandas~=2.0.0 +requests~=2.32.3 +pandas~=2.2.0 typing~=3.7.4.3 -tabulate~=0.8.10 +tabulate~=0.9.0 pytz~=2022.2.1 -termcolor~=1.1.0 -setuptools~=60.2.0 +termcolor~=2.4.0 +setuptools~=72.1.0 python-dotenv rich -validators==0.20.0 -msgram-core==1.4.5 -msgram-parser==1.1.3 +validators==0.33.0 +msgram-core~=1.4.6 +msgram-parser~=1.2.1 anytree From 845627be1f9c6537b36964eafda47452ea909577 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 2 Aug 2024 03:01:35 -0300 Subject: [PATCH 25/52] =?UTF-8?q?bug(calculate=5Fseparado):=20alterando=20?= =?UTF-8?q?calculate=20para=20separa=C3=A7=C3=A3o=20e=20corrigindo=20erros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_calculate.py | 10 +++++----- src/cli/jsonReader/jsonReader.py | 11 +++++++++-- src/cli/parsers.py | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 08fddd7d..9ea1fba6 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -38,9 +38,6 @@ def read_config_file(input_format, config_path): def calculate_metrics(input_format, extracted_path, config): data_calculated = [] - print('teste: ', extracted_path) - print('format: ', input_format) - if not extracted_path.is_file(): if not aggregate_metrics(input_format, extracted_path, config): print_error( @@ -48,14 +45,17 @@ def calculate_metrics(input_format, extracted_path, config): ) return data_calculated, False - print('passed\n\n\n') - for file, file_name in read_multiple_files(extracted_path, "metrics"): + for file, file_name in read_multiple_files(extracted_path, input_format, "metrics"): + if file_name.startswith("github_"): + file_name = file_name[len("github_"):] result = calculate_all(file, file_name, config) data_calculated.append(result) return data_calculated, True else: try: + if extracted_path.name.startswith("github_"): + extracted_path.name = extracted_path.name[len("github_"):] result = calculate_all( open_json_file(extracted_path), extracted_path.name, config ) diff --git a/src/cli/jsonReader/jsonReader.py b/src/cli/jsonReader/jsonReader.py index 36fbefad..2f0cd328 100644 --- a/src/cli/jsonReader/jsonReader.py +++ b/src/cli/jsonReader/jsonReader.py @@ -29,8 +29,15 @@ def file_reader(path_file): return components -def read_multiple_files(directory: Path, pattern: str): - for path_file in directory.glob(f"*.{pattern}"): +def read_multiple_files(directory: Path, format: str, pattern: str): + if format == "github": + glob_pattern = f"github_*.{pattern}" + elif format == "sonarqube": + glob_pattern = f"[!github_]*.{pattern}" + else: + glob_pattern = f"*.{pattern}" + + for path_file in directory.glob(glob_pattern): try: yield open_json_file(path_file), path_file.name except exceptions.MeasureSoftGramCLIException: diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 5b6e3825..39362811 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -173,6 +173,7 @@ def create_parser(): parser_calculate.add_argument( "-in", "--input_format", + required=True, type=str, choices=AVAILABLE_IMPORTS, default="sonarqube", From 3a9165c95787d1b2868cc87e4af2f5f4ae94c0ef Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Fri, 2 Aug 2024 14:44:55 -0300 Subject: [PATCH 26/52] Fix workflow flag --- src/cli/commands/cmd_extract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 2e6128cc..0bffb71d 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows if workflows.split(',') else "build", + "workflows": workflows.split(',') if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( From d764e2af561f51fa9c876e1fdd24d57ec20095ab Mon Sep 17 00:00:00 2001 From: Andre Alves Date: Fri, 2 Aug 2024 14:46:26 -0300 Subject: [PATCH 27/52] Update to v3.2.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3202db9d..cf9bf4f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "msgram" -version = "3.2.0" +version = "3.2.1" description = "The msgram CLI is a command-line interface to use MeasureSoftGram software" readme = "README.md" authors = [ From a7812e2869862d2c7f3c3731b4f87c9ab133f56c Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Thu, 15 Aug 2024 14:30:18 -0300 Subject: [PATCH 28/52] fix: add treatment to json files not found in extraction --- src/cli/commands/cmd_extract.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 0bffb71d..cc5232f4 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -132,6 +132,11 @@ def command_extract(args): logger.debug(f"extracted_path: {extracted_path}") files = list(data_path.glob("*.json")) + + if not files: + print_warn(f"No JSON files found in the specified data_path: {data_path}\n") + sys.exit(1) + valid_files = len(files) print_info(f"\n> Extract and save metrics [[blue ]{output_origin}[/]]:") From 935a5615e40a6523170d8f211cc61ad1773d0d33 Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Sun, 18 Aug 2024 11:14:46 -0300 Subject: [PATCH 29/52] feat: Altera import e export da diff --- src/cli/commands/cmd_diff.py | 30 ++++++++++----- src/cli/commands/cmd_extract.py | 2 +- src/cli/parsers.py | 20 +++++----- src/cli/utils.py | 37 +++++++++++-------- tests/unit/test_diff.py | 65 +++++++-------------------------- 5 files changed, 66 insertions(+), 88 deletions(-) diff --git a/src/cli/commands/cmd_diff.py b/src/cli/commands/cmd_diff.py index fe18c857..ff53134f 100644 --- a/src/cli/commands/cmd_diff.py +++ b/src/cli/commands/cmd_diff.py @@ -24,13 +24,11 @@ def read_config_file(config_path): try: - json = open_json_file(config_path / DIFF_FILE_CONFIG) + json = open_json_file(config_path) return sorted(json, key=lambda x: x["key"]) except exceptions.MeasureSoftGramCLIException as e: - print_error( - f"[red]Error reading msgram_diff.json config file in {config_path}: {e}\n" - ) + print_error(f"[red]Error reading config file in {config_path}: {e}\n") print_rule() exit(1) @@ -107,8 +105,8 @@ def calculate_diff(planned, calculated): def command_diff(args): try: output_format: str = args["output_format"] - config_path = args["config_path"] - extracted_calculation = args["extracted_calculation"] + config_path = args["rp_path"] + extracted_calculation = args["rd_path"] except KeyError as e: logger.error(f"KeyError: args[{e}] - non-existent parameters") @@ -130,6 +128,8 @@ def command_diff(args): if success: print_info("\n[#A9A9A9]Diff calculation performed[/] successfully!") + else: + exit(1) show_results(output_format, diff_calculated, config_path) print_rule() @@ -167,7 +167,7 @@ def show_tabulate(data_calculated): def export_json(data_calculated: list, file_path: Path = DEFAULT_CONFIG_PATH): - file_path = file_path.joinpath("calc_diff_msgram.json") + file_path = file_path.parent.joinpath("calc_diff_msgram.json") with open(file_path, "w", encoding="utf-8") as write_file: json.dump( data_calculated, @@ -178,10 +178,17 @@ def export_json(data_calculated: list, file_path: Path = DEFAULT_CONFIG_PATH): def export_csv(data_calculated: list, file_path: Path = Path("DEFAULT_CONFIG_PATH")): - file_path = file_path.joinpath("calc_diff_msgram.csv") + file_path = file_path.parent.joinpath("calc_diff_msgram.csv") with open(file_path, "w", newline="") as csv_file: - fieldnames = ["repository", "version", "key", "planned", "developed", "diff"] + fieldnames = [ + "repository", + "version", + "characteristic", + "planned", + "developed", + "diff", + ] writer = csv.DictWriter(csv_file, fieldnames=fieldnames) writer.writeheader() @@ -191,7 +198,10 @@ def export_csv(data_calculated: list, file_path: Path = Path("DEFAULT_CONFIG_PAT { "repository": data["repository"], "version": data["version"], - **row, + "characteristic": row.get("key", ""), + "planned": row.get("planned", ""), + "developed": row.get("developed", ""), + "diff": row.get("diff", ""), } ) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 0bffb71d..6a7d9eb5 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows.split(',') if workflows else "build", + "workflows": workflows.split(",") if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 253231cb..25a3d38a 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -211,28 +211,26 @@ def create_parser(): ) parser_calculate.add_argument( - "-ec", - "--extracted_calculation", + "-rd", + "--rd_path", type=lambda p: Path(p).absolute(), - help="Path to the calculated directory", + help="Path to the .json file with the model-calculated values for a release's quality characteristics observed/developed.", ) parser_calculate.add_argument( - "-cp", - "--config_path", + "-rp", + "--rp_path", type=lambda p: Path(p).absolute(), - default=DEFAULT_CONFIG_PATH, - help="Path to the config directory", + help="Path to the .json file with the planned/wished values for the quality characteristics of a release. Quality requirements goals for a release.", ) parser_calculate.add_argument( - "-o", + "-of", "--output_format", type=str, choices=AVAILABLE_GEN_FORMATS, - default="json", - help=("The format of the output (export) values are: ".join(SUPPORTED_FORMATS)), + help=("The format of the output (export) values is tabular"), ) - parser_calculate.set_defaults(func=command_diff) # function command calculate + parser_calculate.set_defaults(func=command_diff) return parser diff --git a/src/cli/utils.py b/src/cli/utils.py index 63f4fc5e..ca5f34a6 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -7,6 +7,7 @@ from rich.panel import Panel from rich.progress import BarColumn, Progress, TaskProgressColumn, TextColumn from rich.table import Table +from rich.text import Text logger = logging.getLogger("msgram") console = Console(highlight=False, soft_wrap=False, width=140) @@ -119,7 +120,7 @@ def print_diff_table(the_dict: dict, table_name: str = "", field: str = ""): table = Table( title=table_name, title_style="bold", - row_styles=["none", "dim"], + row_styles=["none"], border_style="bright_yellow", pad_edge=False, box=box.MINIMAL, @@ -130,39 +131,45 @@ def print_diff_table(the_dict: dict, table_name: str = "", field: str = ""): no_wrap=True, header_style="bold cyan", footer_style="bright_cian", - style="cyan", ) table.add_column( "Planned", no_wrap=True, - header_style="bold red", - footer_style="bright_red", - style="red", + header_style="bold cyan", + footer_style="bright_cian", ) table.add_column( "Developed", no_wrap=True, - header_style="bold red", - footer_style="bright_red", - style="red", + header_style="bold cyan", + footer_style="bright_cian", ) table.add_column( "Diff", no_wrap=True, - header_style="bold red", - footer_style="bright_red", - style="red", + header_style="bold cyan", + footer_style="bright_cian", ) for field, value in the_dict.items(): + row_style = format_diff_color(value) table.add_row( - str(field), - str(value["planned"]), - str(value["developed"]), - str(value["diff"]), + Text(str(field), style=row_style), + Text(str(value["planned"]), style=row_style), + Text(str(value["developed"]), style=row_style), + Text(str(value["diff"]), style=row_style), ) console.print(table) + + +def format_diff_color(value): + if value["planned"] - value["developed"] < 0: + return "green" + elif value["planned"] - value["developed"] > 0: + return "red" + else: + return "white" diff --git a/tests/unit/test_diff.py b/tests/unit/test_diff.py index d363d7b4..bf36caa3 100644 --- a/tests/unit/test_diff.py +++ b/tests/unit/test_diff.py @@ -13,14 +13,12 @@ CALCULATE_ARGS = { "output_format": "json", - "config_path": Path(""), - "extracted_calculation": Path(""), + "rp_path": Path(""), + "rd_path": Path(""), } -@pytest.mark.parametrize( - "diff_arg", ["output_format", "config_path", "extracted_calculation"] -) +@pytest.mark.parametrize("diff_arg", ["output_format", "rp_path", "rd_path"]) def test_diff_invalid_args(diff_arg): captured_output = StringIO() sys.stdout = captured_output @@ -55,8 +53,8 @@ def test_diff_file(): args = { "output_format": "json", - "config_path": Path(config_dirpath), - "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + "rp_path": Path(config_dirpath + "/msgram_diff.json"), + "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } command_diff(args) @@ -84,8 +82,8 @@ def test_diff_invalid_config_file(): args = { "output_format": "csv", - "config_path": Path(config_dirpath), - "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + "rp_path": Path(config_dirpath + "/msgram_diff.json"), + "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } with pytest.raises(SystemExit): @@ -93,8 +91,7 @@ def test_diff_invalid_config_file(): sys.stdout = sys.__stdout__ assert ( - f"Error reading msgram_diff.json config file in {config_dirpath}" - in captured_output.getvalue() + f"Error reading config file in {config_dirpath}" in captured_output.getvalue() ) shutil.rmtree(config_dirpath) @@ -112,8 +109,8 @@ def test_diff_invalid_calculated_file(): args = { "output_format": "csv", - "config_path": Path(config_dirpath), - "extracted_calculation": Path(config_dirpath + "/calc_msgram_error.json"), + "rp_path": Path(config_dirpath + "/msgram_diff.json"), + "rd_path": Path(config_dirpath + "/calc_msgram_error.json"), } with pytest.raises(SystemExit): @@ -145,8 +142,8 @@ def test_diff_invalid_vectors_size(): args = { "output_format": "csv", - "config_path": Path(config_dirpath), - "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + "rp_path": Path(config_dirpath + "/msgram_diff.json"), + "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } command_diff(args) @@ -177,8 +174,8 @@ def test_diff_differents_characteristics(): args = { "output_format": "csv", - "config_path": Path(config_dirpath), - "extracted_calculation": Path(config_dirpath + "/calc_msgram_diff.json"), + "rp_path": Path(config_dirpath + "/msgram_diff.json"), + "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } command_diff(args) @@ -190,37 +187,3 @@ def test_diff_differents_characteristics(): ) shutil.rmtree(config_dirpath) - - -# def test_calculate_invalid_extracted_file(): -# captured_output = StringIO() -# sys.stdout = captured_output - -# config_dirpath = tempfile.mkdtemp() -# extract_dirpath = tempfile.mkdtemp() - -# shutil.copy("tests/unit/data/msgram.json", f"{config_dirpath}/msgram.json") - -# extracted_file_name = "invalid_json.json" -# shutil.copy( -# f"tests/unit/data/{extracted_file_name}", -# f"{extract_dirpath}/{extracted_file_name}", -# ) - -# args = { -# "output_format": "csv", -# "config_path": Path(config_dirpath), -# "extracted_path": Path(extract_dirpath + f"/{extracted_file_name}"), -# } - -# command_calculate(args) - -# sys.stdout = sys.__stdout__ -# assert ( -# f"Error calculating {extract_dirpath}/{extracted_file_name}" -# in captured_output.getvalue() -# ) -# assert "All calculations performed" not in captured_output.getvalue() - -# shutil.rmtree(config_dirpath) -# shutil.rmtree(extract_dirpath) From 3e0dc97780452f28e93d101e0fbf73811ff7eddf Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Sun, 18 Aug 2024 21:38:00 -0300 Subject: [PATCH 30/52] fix: Ajusta testes --- requirements.txt | 2 +- src/cli/commands/cmd_diff.py | 2 +- src/cli/parsers.py | 6 ++++-- tests/unit/test_diff.py | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index ee37da00..bfd7c8ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,6 @@ setuptools~=72.1.0 python-dotenv rich validators==0.33.0 -msgram-core~=1.4.6 +msgram-core==1.4.6 msgram-parser~=1.2.1 anytree diff --git a/src/cli/commands/cmd_diff.py b/src/cli/commands/cmd_diff.py index ff53134f..04b1d0c6 100644 --- a/src/cli/commands/cmd_diff.py +++ b/src/cli/commands/cmd_diff.py @@ -17,7 +17,7 @@ print_rule, ) from src.cli.exceptions import exceptions -from src.config.settings import DEFAULT_CONFIG_PATH, DIFF_FILE_CONFIG +from src.config.settings import DEFAULT_CONFIG_PATH logger = logging.getLogger("msgram") diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 25a3d38a..474347f1 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -214,14 +214,16 @@ def create_parser(): "-rd", "--rd_path", type=lambda p: Path(p).absolute(), - help="Path to the .json file with the model-calculated values for a release's quality characteristics observed/developed.", + help="Path to the .json file with the model-calculated values for a release's quality" + "characteristics observed/developed.", ) parser_calculate.add_argument( "-rp", "--rp_path", type=lambda p: Path(p).absolute(), - help="Path to the .json file with the planned/wished values for the quality characteristics of a release. Quality requirements goals for a release.", + help="Path to the .json file with the planned/wished values for the quality characteristics" + "of a release. Quality requirements goals for a release.", ) parser_calculate.add_argument( diff --git a/tests/unit/test_diff.py b/tests/unit/test_diff.py index bf36caa3..2bf0c5e8 100644 --- a/tests/unit/test_diff.py +++ b/tests/unit/test_diff.py @@ -146,7 +146,8 @@ def test_diff_invalid_vectors_size(): "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } - command_diff(args) + with pytest.raises(SystemExit): + command_diff(args) sys.stdout = sys.__stdout__ assert ( @@ -178,7 +179,8 @@ def test_diff_differents_characteristics(): "rd_path": Path(config_dirpath + "/calc_msgram_diff.json"), } - command_diff(args) + with pytest.raises(SystemExit): + command_diff(args) sys.stdout = sys.__stdout__ assert ( From 7c0d350a629a45c220dea2c38289d651c5b05768 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 20 Aug 2024 16:54:11 -0300 Subject: [PATCH 31/52] =?UTF-8?q?fix(bug/008):=20adapta=C3=A7=C3=A3o=20ini?= =?UTF-8?q?cial=20=C3=A0=20forma=20correta=20de=20separa=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/aggregate_metrics.py | 33 ++++++++------------------ src/cli/commands/cmd_calculate.py | 8 +++---- src/cli/resources/measure.py | 17 +++++++------ src/cli/resources/subcharacteristic.py | 5 +++- src/config/settings.py | 2 -- 5 files changed, 28 insertions(+), 37 deletions(-) diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index 18be259b..f91b1448 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -37,11 +37,11 @@ measures["github"] = ["team_throughput", "ci_feedback_time"] -def should_process_metrics(input_format, config): +def should_process_metrics(config): for characteristic in config.get("characteristics", []): for subcharacteristic in characteristic.get("subcharacteristics", []): for measure in subcharacteristic.get("measures", []): - if measure.get("key") not in measures[input_format]: + if measure.get("key") not in measures["sonarqube"] and measure.get("key") not in measures["github"]: return False return True @@ -118,30 +118,17 @@ def aggregate_metrics(input_format, folder_path, config: json): have_metrics = False - if input_format == "github": - if should_process_metrics(input_format, config): - result = process_metrics(folder_path, github_files) + if should_process_metrics(config): + result = process_metrics(folder_path, github_files if input_format == "github" else sonar_files) - if not result: - print_error("> [red]Error: Unexpected result from process_github_metrics") - return False - - have_metrics = True - else: - print_error("> [red]Error: Unexpected measures from should_process_metrics") + if not result: + print_error("> [red]Error: Unexpected result from process_github_metrics") return False - if input_format == "sonarqube": - if should_process_metrics(input_format, config): - result = process_metrics(folder_path, sonar_files) - - if not result: - print_error("> [red]Error: Unexpected result from process_sonar_metrics") - return False - have_metrics = True - else: - print_error("> [red]Error: Unexpected measures from should_process_metrics") - return False + have_metrics = True + else: + print_error("> [red]Error: Unexpected measures from should_process_metrics") + return False if not have_metrics: print_error(f"> [red]Error: No metrics where found in the .msgram files from the type: {input_format}") diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 9ea1fba6..144c0d08 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -18,14 +18,14 @@ from src.cli.utils import print_error, print_info, print_panel, print_rule, print_table from src.cli.aggregate_metrics import aggregate_metrics from src.cli.exceptions import exceptions -from src.config.settings import DEFAULT_CONFIG_PATH, FILE_CONFIG_GITHUB, FILE_CONFIG_SONARQUBE +from src.config.settings import DEFAULT_CONFIG_PATH, FILE_CONFIG logger = logging.getLogger("msgram") -def read_config_file(input_format, config_path): +def read_config_file(config_path): try: - config = FILE_CONFIG_SONARQUBE if input_format == "sonarqube" else FILE_CONFIG_GITHUB + config = FILE_CONFIG return open_json_file(config_path / config) except exceptions.MeasureSoftGramCLIException as e: print_error( @@ -82,7 +82,7 @@ def command_calculate(args): print_rule("Calculate") print_info("> [blue] Reading config file:[/]") - config = read_config_file(input_format, config_path) + config = read_config_file(config_path) print_info("\n> [blue] Reading extracted files:[/]") diff --git a/src/cli/resources/measure.py b/src/cli/resources/measure.py index d794c2ba..d6d85e59 100644 --- a/src/cli/resources/measure.py +++ b/src/cli/resources/measure.py @@ -12,14 +12,17 @@ def get_measure_value(measures, subchar): measures_calculated = [] for measure in subchar: measure_key = measure["key"] - measures_calculated.append( - { - "key": measure_key, - "value": {m["key"]: m["value"] for m in measures}[measure_key], - "weight": measure["weight"], - } - ) + found = any(measure_key == m["key"] for m in measures) + if found: + measures_calculated.append( + { + "key": measure_key, + "value": {m["key"]: m["value"] for m in measures}[measure_key], + "weight": measure["weight"], + } + ) + # print('calculated: ', measures_calculated) return measures_calculated diff --git a/src/cli/resources/subcharacteristic.py b/src/cli/resources/subcharacteristic.py index 0e641407..43140398 100644 --- a/src/cli/resources/subcharacteristic.py +++ b/src/cli/resources/subcharacteristic.py @@ -32,7 +32,10 @@ def calculate_subcharacteristics(config, measures): "key": subchar["key"], "measures": get_measure_value(measures, subchar["measures"]), } - calculate_infos.append(subchar_info) + if(len(subchar_info["measures"])>0): + calculate_infos.append(subchar_info) headers = ["Id", "Name", "Description", "Value", "Created at"] + + print('subcar infos: ', calculate_infos) return core_calculate({"subcharacteristics": calculate_infos}), headers diff --git a/src/config/settings.py b/src/config/settings.py index 5b636562..91d86549 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -1,7 +1,5 @@ from pathlib import Path -FILE_CONFIG_SONARQUBE = "msgram_sonarqube.json" -FILE_CONFIG_GITHUB = "msgram_github.json" FILE_CONFIG = "msgram.json" DEFAULT_CONFIG_PATH = Path.cwd() / ".msgram" DEFAULT_RAW_DATA_PATH = Path.cwd() / "analytics-raw-data" From 6d49cdd941955de475219982172976fdf9e1101b Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 20 Aug 2024 20:31:30 -0300 Subject: [PATCH 32/52] =?UTF-8?q?fix(bug/008):=20completando=20separa?= =?UTF-8?q?=C3=A7=C3=A3o=20do=20calculate=20entre=20github=20e=20sonar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/resources/characteristic.py | 33 ++++++++++++++------------ src/cli/resources/subcharacteristic.py | 21 ++++++++-------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/cli/resources/characteristic.py b/src/cli/resources/characteristic.py index 4ef03be1..8798fd32 100644 --- a/src/cli/resources/characteristic.py +++ b/src/cli/resources/characteristic.py @@ -8,13 +8,15 @@ def get_characteristic_value(chars, tsqmi): for char in tsqmi: char_key = char["key"] - char_calculated.append( - { - "key": char_key, - "value": {m["key"]: m["value"] for m in chars}[char_key], - "weight": char["weight"], - } - ) + found = any(char_key == m["key"] for m in chars) + if found: + char_calculated.append( + { + "key": char_key, + "value": {m["key"]: m["value"] for m in chars}[char_key], + "weight": char["weight"], + } + ) return char_calculated @@ -24,14 +26,15 @@ def calculate_characteristics(config, subchars): calculate_infos = [] for char in characteristics: - calculate_infos.append( - { - "key": char["key"], - "subcharacteristics": get_subcharacteristic_value( - subchars, char["subcharacteristics"] - ), - } - ) + char_info = { + "key": char["key"], + "subcharacteristics": get_subcharacteristic_value( + subchars, char["subcharacteristics"] + ), + } + if(len(char_info["subcharacteristics"])>0): + calculate_infos.append(char_info) headers = ["Id", "Name", "Description", "Value", "Created at"] + return core_calculate({"characteristics": calculate_infos}), headers diff --git a/src/cli/resources/subcharacteristic.py b/src/cli/resources/subcharacteristic.py index 43140398..5b8d287d 100644 --- a/src/cli/resources/subcharacteristic.py +++ b/src/cli/resources/subcharacteristic.py @@ -8,15 +8,17 @@ def get_subcharacteristic_value(subchars, char): for subchar in char: subchar_key = subchar["key"] - subchar_calculated.append( - { - "key": subchar_key, - "value": {m["key"]: m["value"] for m in subchars}.get( - subchar_key, None - ), - "weight": subchar["weight"], - } - ) + found = any(subchar_key == m["key"] for m in subchars) + if found: + subchar_calculated.append( + { + "key": subchar_key, + "value": {m["key"]: m["value"] for m in subchars}.get( + subchar_key, None + ), + "weight": subchar["weight"], + } + ) return subchar_calculated @@ -37,5 +39,4 @@ def calculate_subcharacteristics(config, measures): headers = ["Id", "Name", "Description", "Value", "Created at"] - print('subcar infos: ', calculate_infos) return core_calculate({"subcharacteristics": calculate_infos}), headers From e784442fa599773df1e17d4bcb96fe2b044df1e3 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 20 Aug 2024 21:55:18 -0300 Subject: [PATCH 33/52] tests(bug/008): testes de aggregate e novos arquivos --- src/cli/aggregate_metrics.py | 13 +- src/cli/commands/cmd_calculate.py | 12 +- src/cli/jsonReader/jsonReader.py | 2 +- src/cli/resources/characteristic.py | 4 +- src/cli/resources/subcharacteristic.py | 2 +- tests/unit/data/allmsgram.json | 47 - ...-DOC-28-07-2024-00-00-22-extracted.metrics | 24 + ...m-DOC-28-07-2024-00-00-22-extracted.msgram | 24 + ...-json-19-11-2023-12-53-58-extracted.msgram | 1318 ----------------- tests/unit/data/msgram.json | 60 +- tests/unit/data/onlygithubmsgram.json | 27 +- tests/unit/data/onlysonarmsgram.json | 64 + tests/unit/test_aggregate.py | 200 +-- 13 files changed, 275 insertions(+), 1522 deletions(-) delete mode 100644 tests/unit/data/allmsgram.json create mode 100644 tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics create mode 100644 tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.msgram delete mode 100644 tests/unit/data/github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram create mode 100644 tests/unit/data/onlysonarmsgram.json diff --git a/src/cli/aggregate_metrics.py b/src/cli/aggregate_metrics.py index f91b1448..70c21ded 100644 --- a/src/cli/aggregate_metrics.py +++ b/src/cli/aggregate_metrics.py @@ -41,7 +41,10 @@ def should_process_metrics(config): for characteristic in config.get("characteristics", []): for subcharacteristic in characteristic.get("subcharacteristics", []): for measure in subcharacteristic.get("measures", []): - if measure.get("key") not in measures["sonarqube"] and measure.get("key") not in measures["github"]: + if ( + measure.get("key") not in measures["sonarqube"] + and measure.get("key") not in measures["github"] + ): return False return True @@ -119,7 +122,9 @@ def aggregate_metrics(input_format, folder_path, config: json): have_metrics = False if should_process_metrics(config): - result = process_metrics(folder_path, github_files if input_format == "github" else sonar_files) + result = process_metrics( + folder_path, github_files if input_format == "github" else sonar_files + ) if not result: print_error("> [red]Error: Unexpected result from process_github_metrics") @@ -131,7 +136,9 @@ def aggregate_metrics(input_format, folder_path, config: json): return False if not have_metrics: - print_error(f"> [red]Error: No metrics where found in the .msgram files from the type: {input_format}") + print_error( + f"> [red]Error: No metrics where found in the .msgram files from the type: {input_format}" + ) return False for filename, file_content in result: diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 144c0d08..73d0e748 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -28,9 +28,7 @@ def read_config_file(config_path): config = FILE_CONFIG return open_json_file(config_path / config) except exceptions.MeasureSoftGramCLIException as e: - print_error( - f"[red]Error reading {config} config file in {config_path}: {e}\n" - ) + print_error(f"[red]Error reading {config} config file in {config_path}: {e}\n") print_rule() exit(1) @@ -45,9 +43,11 @@ def calculate_metrics(input_format, extracted_path, config): ) return data_calculated, False - for file, file_name in read_multiple_files(extracted_path, input_format, "metrics"): + for file, file_name in read_multiple_files( + extracted_path, input_format, "metrics" + ): if file_name.startswith("github_"): - file_name = file_name[len("github_"):] + file_name = file_name[len("github_") :] result = calculate_all(file, file_name, config) data_calculated.append(result) @@ -55,7 +55,7 @@ def calculate_metrics(input_format, extracted_path, config): else: try: if extracted_path.name.startswith("github_"): - extracted_path.name = extracted_path.name[len("github_"):] + extracted_path.name = extracted_path.name[len("github_") :] result = calculate_all( open_json_file(extracted_path), extracted_path.name, config ) diff --git a/src/cli/jsonReader/jsonReader.py b/src/cli/jsonReader/jsonReader.py index 2f0cd328..bb454564 100644 --- a/src/cli/jsonReader/jsonReader.py +++ b/src/cli/jsonReader/jsonReader.py @@ -36,7 +36,7 @@ def read_multiple_files(directory: Path, format: str, pattern: str): glob_pattern = f"[!github_]*.{pattern}" else: glob_pattern = f"*.{pattern}" - + for path_file in directory.glob(glob_pattern): try: yield open_json_file(path_file), path_file.name diff --git a/src/cli/resources/characteristic.py b/src/cli/resources/characteristic.py index 8798fd32..9fb8c21d 100644 --- a/src/cli/resources/characteristic.py +++ b/src/cli/resources/characteristic.py @@ -32,8 +32,8 @@ def calculate_characteristics(config, subchars): subchars, char["subcharacteristics"] ), } - if(len(char_info["subcharacteristics"])>0): - calculate_infos.append(char_info) + if len(char_info["subcharacteristics"]) > 0: + calculate_infos.append(char_info) headers = ["Id", "Name", "Description", "Value", "Created at"] diff --git a/src/cli/resources/subcharacteristic.py b/src/cli/resources/subcharacteristic.py index 5b8d287d..e4bc0584 100644 --- a/src/cli/resources/subcharacteristic.py +++ b/src/cli/resources/subcharacteristic.py @@ -34,7 +34,7 @@ def calculate_subcharacteristics(config, measures): "key": subchar["key"], "measures": get_measure_value(measures, subchar["measures"]), } - if(len(subchar_info["measures"])>0): + if len(subchar_info["measures"]) > 0: calculate_infos.append(subchar_info) headers = ["Id", "Name", "Description", "Value", "Created at"] diff --git a/tests/unit/data/allmsgram.json b/tests/unit/data/allmsgram.json deleted file mode 100644 index 883fef01..00000000 --- a/tests/unit/data/allmsgram.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "characteristics": [ - { - "key": "reliability", - "weight": 34, - "subcharacteristics": [ - { - "key": "testing_status", - "weight": 100, - "measures": [ - {"key": "passed_tests", "weight": 33, "min_threshold": 0, "max_threshold": 1}, - {"key": "test_builds", "weight": 33, "min_threshold": 0, "max_threshold": 300000}, - {"key": "test_coverage", "weight": 34, "min_threshold": 60, "max_threshold": 100} - ] - } - ] - }, - { - "key": "maintainability", - "weight": 33, - "subcharacteristics": [ - { - "key": "modifiability", - "weight": 100, - "measures": [ - {"key": "non_complex_file_density", "weight": 33, "min_threshold": 0, "max_threshold": 10}, - {"key": "commented_file_density", "weight": 33, "min_threshold": 10, "max_threshold": 30}, - {"key": "duplication_absence", "weight": 34, "min_threshold": 0, "max_threshold": 5} - ] - } - ] - }, - { - "key": "functional_suitability", - "weight": 33, - "subcharacteristics": [ - { - "key": "functional_completeness", - "weight": 100, - "measures": [ - {"key": "team_throughput", "weight": 100, "min_threshold": 45, "max_threshold": 100} - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics b/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics new file mode 100644 index 00000000..c0a317cf --- /dev/null +++ b/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics @@ -0,0 +1,24 @@ +{ + "fga-eps-mds/2024.1-MeasureSoftGram-DOC": [ + { + "metric": "resolved_issues", + "value": 1.0 + }, + { + "metric": "resolved_ratio", + "value": 0.16666666666666666 + }, + { + "metric": "sum_ci_feedback_times", + "value": 925.0 + }, + { + "metric": "total_builds", + "value": 30.0 + }, + { + "metric": "total_issues", + "value": 6.0 + } + ] +} \ No newline at end of file diff --git a/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.msgram b/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.msgram new file mode 100644 index 00000000..4266b975 --- /dev/null +++ b/tests/unit/data/github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.msgram @@ -0,0 +1,24 @@ +{ + "fga-eps-mds/2024.1-MeasureSoftGram-DOC": [ + { + "metric": "resolved_issues", + "value": 1.0 + }, + { + "metric": "resolved_ratio", + "value": 0.16666666666666666 + }, + { + "metric": "sum_ci_feedback_times", + "value": 925.0 + }, + { + "metric": "total_builds", + "value": 30.0 + }, + { + "metric": "total_issues", + "value": 6.0 + } + ] +} \ No newline at end of file diff --git a/tests/unit/data/github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram b/tests/unit/data/github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram deleted file mode 100644 index 17e2806a..00000000 --- a/tests/unit/data/github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram +++ /dev/null @@ -1,1318 +0,0 @@ -{ - "nlohmann/json": [ - { - "metric": "commits_on_friday", - "value": 414 - }, - { - "metric": "commits_on_monday", - "value": 489 - }, - { - "metric": "commits_on_saturday", - "value": 519 - }, - { - "metric": "commits_on_sunday", - "value": 819 - }, - { - "metric": "commits_on_thursday", - "value": 397 - }, - { - "metric": "commits_on_tuesday", - "value": 510 - }, - { - "metric": "commits_on_wednesday", - "value": 564 - }, - { - "metric": "created_at", - "value": "2013-07-04T08:47:49Z" - }, - { - "metric": "forks", - "value": 6343 - }, - { - "metric": "forks_count", - "value": 6343 - }, - { - "metric": "health_percentage", - "value": 100 - }, - { - "metric": "open_issues", - "value": 101 - }, - { - "metric": "open_issues_count", - "value": 101 - }, - { - "metric": "pull_request_4111", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4111" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4111/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4111 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-08-15T18:23:03Z" - }, - { - "metric": "updated_at", - "value": "2023-09-24T09:13:11Z" - }, - { - "metric": "closed_at", - "value": "2023-09-24T09:13:10Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4112", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4112" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4112/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4112 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-08-16T07:55:38Z" - }, - { - "metric": "updated_at", - "value": "2023-09-25T21:51:20Z" - }, - { - "metric": "closed_at", - "value": "2023-09-25T07:31:26Z" - }, - { - "metric": "merged_at", - "value": "2023-09-25T07:31:26Z" - } - ] - }, - { - "metric": "pull_request_4115", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4115" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4115/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4115 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-08-19T13:45:47Z" - }, - { - "metric": "updated_at", - "value": "2023-09-24T09:17:15Z" - }, - { - "metric": "closed_at", - "value": "2023-09-24T09:17:15Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4126", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4126" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4126/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4126 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-08-28T19:55:17Z" - }, - { - "metric": "updated_at", - "value": "2023-08-28T20:08:50Z" - }, - { - "metric": "closed_at", - "value": "2023-08-28T20:04:08Z" - }, - { - "metric": "merged_at", - "value": "2023-08-28T20:04:08Z" - } - ] - }, - { - "metric": "pull_request_4137", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4137" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4137/commits" - }, - { - "metric": "state", - "value": "open" - }, - { - "metric": "number", - "value": 4137 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-06T14:10:07Z" - }, - { - "metric": "updated_at", - "value": "2023-10-19T17:23:31Z" - }, - { - "metric": "closed_at", - "value": null - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4138", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4138" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4138/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4138 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-06T18:06:48Z" - }, - { - "metric": "updated_at", - "value": "2023-09-23T13:21:20Z" - }, - { - "metric": "closed_at", - "value": "2023-09-23T13:21:03Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4140", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4140" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4140/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4140 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-07T12:45:52Z" - }, - { - "metric": "updated_at", - "value": "2023-09-23T15:32:28Z" - }, - { - "metric": "closed_at", - "value": "2023-09-23T15:21:40Z" - }, - { - "metric": "merged_at", - "value": "2023-09-23T15:21:40Z" - } - ] - }, - { - "metric": "pull_request_4143", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4143" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4143/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4143 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-10T19:48:39Z" - }, - { - "metric": "updated_at", - "value": "2023-09-10T19:58:57Z" - }, - { - "metric": "closed_at", - "value": "2023-09-10T19:49:39Z" - }, - { - "metric": "merged_at", - "value": "2023-09-10T19:49:39Z" - } - ] - }, - { - "metric": "pull_request_4149", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4149" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4149/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4149 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-14T14:52:06Z" - }, - { - "metric": "updated_at", - "value": "2023-09-14T15:46:43Z" - }, - { - "metric": "closed_at", - "value": "2023-09-14T15:46:34Z" - }, - { - "metric": "merged_at", - "value": "2023-09-14T15:46:34Z" - } - ] - }, - { - "metric": "pull_request_4153", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4153" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4153/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4153 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-16T09:45:27Z" - }, - { - "metric": "updated_at", - "value": "2023-09-16T09:50:01Z" - }, - { - "metric": "closed_at", - "value": "2023-09-16T09:50:01Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4159", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4159" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4159/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4159 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-23T09:54:50Z" - }, - { - "metric": "updated_at", - "value": "2023-09-24T04:25:59Z" - }, - { - "metric": "closed_at", - "value": "2023-09-23T15:20:47Z" - }, - { - "metric": "merged_at", - "value": "2023-09-23T15:20:47Z" - } - ] - }, - { - "metric": "pull_request_4160", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4160" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4160/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4160 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-23T10:33:15Z" - }, - { - "metric": "updated_at", - "value": "2023-09-23T15:19:30Z" - }, - { - "metric": "closed_at", - "value": "2023-09-23T15:19:29Z" - }, - { - "metric": "merged_at", - "value": "2023-09-23T15:19:29Z" - } - ] - }, - { - "metric": "pull_request_4161", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4161" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4161/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4161 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-23T15:40:21Z" - }, - { - "metric": "updated_at", - "value": "2023-09-23T18:16:38Z" - }, - { - "metric": "closed_at", - "value": "2023-09-23T18:16:37Z" - }, - { - "metric": "merged_at", - "value": "2023-09-23T18:16:37Z" - } - ] - }, - { - "metric": "pull_request_4166", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4166" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4166/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4166 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-28T02:47:13Z" - }, - { - "metric": "updated_at", - "value": "2023-10-04T20:17:09Z" - }, - { - "metric": "closed_at", - "value": "2023-10-04T20:17:09Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4167", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4167" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4167/commits" - }, - { - "metric": "state", - "value": "open" - }, - { - "metric": "number", - "value": 4167 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-09-29T11:36:40Z" - }, - { - "metric": "updated_at", - "value": "2023-10-16T09:23:17Z" - }, - { - "metric": "closed_at", - "value": null - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4169", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4169" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4169/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4169 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-02T08:59:25Z" - }, - { - "metric": "updated_at", - "value": "2023-10-02T11:09:58Z" - }, - { - "metric": "closed_at", - "value": "2023-10-02T11:09:53Z" - }, - { - "metric": "merged_at", - "value": "2023-10-02T11:09:53Z" - } - ] - }, - { - "metric": "pull_request_4170", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4170" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4170/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4170 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-03T02:30:53Z" - }, - { - "metric": "updated_at", - "value": "2023-10-04T20:17:45Z" - }, - { - "metric": "closed_at", - "value": "2023-10-04T20:17:33Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4173", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4173" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4173/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4173 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-03T21:24:03Z" - }, - { - "metric": "updated_at", - "value": "2023-10-04T13:24:42Z" - }, - { - "metric": "closed_at", - "value": "2023-10-04T13:24:38Z" - }, - { - "metric": "merged_at", - "value": "2023-10-04T13:24:38Z" - } - ] - }, - { - "metric": "pull_request_4175", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4175" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4175/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4175 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-04T18:12:42Z" - }, - { - "metric": "updated_at", - "value": "2023-10-04T20:46:19Z" - }, - { - "metric": "closed_at", - "value": "2023-10-04T20:16:49Z" - }, - { - "metric": "merged_at", - "value": "2023-10-04T20:16:49Z" - } - ] - }, - { - "metric": "pull_request_4176", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4176" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4176/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4176 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-04T20:17:17Z" - }, - { - "metric": "updated_at", - "value": "2023-10-05T06:41:36Z" - }, - { - "metric": "closed_at", - "value": "2023-10-05T06:41:25Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4177", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4177" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4177/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4177 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-04T20:17:48Z" - }, - { - "metric": "updated_at", - "value": "2023-10-05T06:41:43Z" - }, - { - "metric": "closed_at", - "value": "2023-10-05T06:41:22Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4179", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4179" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4179/commits" - }, - { - "metric": "state", - "value": "open" - }, - { - "metric": "number", - "value": 4179 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-06T04:38:59Z" - }, - { - "metric": "updated_at", - "value": "2023-11-14T21:55:09Z" - }, - { - "metric": "closed_at", - "value": null - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4180", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4180" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4180/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4180 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-07T21:18:22Z" - }, - { - "metric": "updated_at", - "value": "2023-10-31T19:17:47Z" - }, - { - "metric": "closed_at", - "value": "2023-10-31T19:17:43Z" - }, - { - "metric": "merged_at", - "value": "2023-10-31T19:17:43Z" - } - ] - }, - { - "metric": "pull_request_4181", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4181" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4181/commits" - }, - { - "metric": "state", - "value": "open" - }, - { - "metric": "number", - "value": 4181 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-08T11:36:45Z" - }, - { - "metric": "updated_at", - "value": "2023-10-12T07:49:24Z" - }, - { - "metric": "closed_at", - "value": null - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4182", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4182" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4182/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4182 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-10T20:19:21Z" - }, - { - "metric": "updated_at", - "value": "2023-10-10T21:14:56Z" - }, - { - "metric": "closed_at", - "value": "2023-10-10T20:20:08Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4189", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4189" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4189/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4189 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-17T23:33:15Z" - }, - { - "metric": "updated_at", - "value": "2023-10-18T15:00:37Z" - }, - { - "metric": "closed_at", - "value": "2023-10-18T15:00:25Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4194", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4194" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4194/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4194 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-30T17:48:06Z" - }, - { - "metric": "updated_at", - "value": "2023-10-31T18:52:59Z" - }, - { - "metric": "closed_at", - "value": "2023-10-31T18:52:54Z" - }, - { - "metric": "merged_at", - "value": "2023-10-31T18:52:54Z" - } - ] - }, - { - "metric": "pull_request_4196", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4196" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4196/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4196 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-10-31T18:59:23Z" - }, - { - "metric": "updated_at", - "value": "2023-11-01T20:23:56Z" - }, - { - "metric": "closed_at", - "value": "2023-11-01T20:23:55Z" - }, - { - "metric": "merged_at", - "value": "2023-11-01T20:23:55Z" - } - ] - }, - { - "metric": "pull_request_4203", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4203" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4203/commits" - }, - { - "metric": "state", - "value": "closed" - }, - { - "metric": "number", - "value": 4203 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-11-10T04:47:01Z" - }, - { - "metric": "updated_at", - "value": "2023-11-10T04:48:07Z" - }, - { - "metric": "closed_at", - "value": "2023-11-10T04:48:07Z" - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "pull_request_4210", - "value": [ - { - "metric": "issue_url", - "value": "https://api.github.com/repos/nlohmann/json/issues/4210" - }, - { - "metric": "commits_url", - "value": "https://api.github.com/repos/nlohmann/json/pulls/4210/commits" - }, - { - "metric": "state", - "value": "open" - }, - { - "metric": "number", - "value": 4210 - }, - { - "metric": "draft", - "value": false - }, - { - "metric": "created_at", - "value": "2023-11-18T09:41:27Z" - }, - { - "metric": "updated_at", - "value": "2023-11-18T15:37:57Z" - }, - { - "metric": "closed_at", - "value": null - }, - { - "metric": "merged_at", - "value": null - } - ] - }, - { - "metric": "resolved_issues", - "value": 25 - }, - { - "metric": "resolved_ratio", - "value": 0.8333333333333334 - }, - { - "metric": "size", - "value": 181664 - }, - { - "metric": "subscribers_count", - "value": 757 - }, - { - "metric": "total_issues", - "value": 30 - }, - { - "metric": "updated_at", - "value": "2023-10-31T19:27:45Z" - }, - { - "metric": "watchers", - "value": 37501 - }, - { - "metric": "watchers_count", - "value": 37501 - } - ] -} \ No newline at end of file diff --git a/tests/unit/data/msgram.json b/tests/unit/data/msgram.json index 7b179b35..be935d5c 100644 --- a/tests/unit/data/msgram.json +++ b/tests/unit/data/msgram.json @@ -2,29 +2,41 @@ "characteristics": [ { "key": "reliability", - "weight": 50, + "weight": 34, "subcharacteristics": [ { "key": "testing_status", - "weight": 100, + "weight": 50, "measures": [ { "key": "passed_tests", "weight": 33, - "min_passed_tests": 0, - "max_passed_tests": 1 + "min_threshold": 0, + "max_threshold": 1 }, { "key": "test_builds", "weight": 33, - "min_fast_test_time": 0, - "max_fast_test_time": 300000 + "min_threshold": 0, + "max_threshold": 300000 }, { "key": "test_coverage", "weight": 34, - "min_coverage": 60, - "max_coverage": 100 + "min_threshold": 60, + "max_threshold": 100 + } + ] + }, + { + "key": "maturity", + "weight": 50, + "measures": [ + { + "key": "ci_feedback_time", + "weight": 100, + "min_threshold": 1, + "max_threshold": 900 } ] } @@ -32,7 +44,7 @@ }, { "key": "maintainability", - "weight": 50, + "weight": 33, "subcharacteristics": [ { "key": "modifiability", @@ -41,20 +53,38 @@ { "key": "non_complex_file_density", "weight": 33, - "min_complex_files_density": 0, - "max_complex_files_density": 10 + "min_threshold": 0, + "max_threshold": 10 }, { "key": "commented_file_density", "weight": 33, - "min_comment_density": 10, - "max_comment_density": 30 + "min_threshold": 10, + "max_threshold": 30 }, { "key": "duplication_absense", "weight": 34, - "min_duplicated_lines": 0, - "max_duplicated_lines": 5 + "min_threshold": 0, + "max_threshold": 5 + } + ] + } + ] + }, + { + "key": "functional_suitability", + "weight": 33, + "subcharacteristics": [ + { + "key": "functional_completeness", + "weight": 100, + "measures": [ + { + "key": "team_throughput", + "weight": 100, + "min_threshold": 45, + "max_threshold": 100 } ] } diff --git a/tests/unit/data/onlygithubmsgram.json b/tests/unit/data/onlygithubmsgram.json index c6dba820..87e76e13 100644 --- a/tests/unit/data/onlygithubmsgram.json +++ b/tests/unit/data/onlygithubmsgram.json @@ -1,14 +1,37 @@ { "characteristics": [ + { + "key": "reliability", + "weight": 50, + "subcharacteristics": [ + { + "key": "maturity", + "weight": 100, + "measures": [ + { + "key": "ci_feedback_time", + "weight": 100, + "min_threshold": 1, + "max_threshold": 900 + } + ] + } + ] + }, { "key": "functional_suitability", - "weight": 33, + "weight": 50, "subcharacteristics": [ { "key": "functional_completeness", "weight": 100, "measures": [ - {"key": "team_throughput", "weight": 100, "min_threshold": 45, "max_threshold": 100} + { + "key": "team_throughput", + "weight": 100, + "min_threshold": 45, + "max_threshold": 100 + } ] } ] diff --git a/tests/unit/data/onlysonarmsgram.json b/tests/unit/data/onlysonarmsgram.json new file mode 100644 index 00000000..4ded7c63 --- /dev/null +++ b/tests/unit/data/onlysonarmsgram.json @@ -0,0 +1,64 @@ +{ + "characteristics": [ + { + "key": "reliability", + "weight": 50, + "subcharacteristics": [ + { + "key": "testing_status", + "weight": 100, + "measures": [ + { + "key": "passed_tests", + "weight": 33, + "min_threshold": 0, + "max_threshold": 1 + }, + { + "key": "test_builds", + "weight": 33, + "min_threshold": 0, + "max_threshold": 300000 + }, + { + "key": "test_coverage", + "weight": 34, + "min_threshold": 60, + "max_threshold": 100 + } + ] + } + ] + }, + { + "key": "maintainability", + "weight": 50, + "subcharacteristics": [ + { + "key": "modifiability", + "weight": 100, + "measures": [ + { + "key": "non_complex_file_density", + "weight": 33, + "min_threshold": 0, + "max_threshold": 10 + }, + { + "key": "commented_file_density", + "weight": 33, + "min_threshold": 10, + "max_threshold": 30 + }, + { + "key": "duplication_absense", + "weight": 34, + "min_threshold": 0, + "max_threshold": 5 + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/test_aggregate.py b/tests/unit/test_aggregate.py index 1e05c642..6ad598cc 100644 --- a/tests/unit/test_aggregate.py +++ b/tests/unit/test_aggregate.py @@ -5,15 +5,12 @@ from unittest.mock import patch from src.cli.aggregate_metrics import ( - should_process_github_metrics, - should_process_sonar_metrics, + should_process_metrics, ) from src.cli.aggregate_metrics import read_msgram, save_metrics from src.cli.aggregate_metrics import ( - process_github_metrics, - process_sonar_metrics, + process_metrics, aggregate_metrics, - find_common_part, ) @@ -22,8 +19,8 @@ with open(os.path.join(TEST_DATA_DIR, "msgram.json"), "r") as file: config = json.load(file) -with open(os.path.join(TEST_DATA_DIR, "allmsgram.json"), "r") as file: - all_config = json.load(file) +with open(os.path.join(TEST_DATA_DIR, "onlysonarmsgram.json"), "r") as file: + only_sonar_msgram = json.load(file) with open(os.path.join(TEST_DATA_DIR, "onlygithubmsgram.json"), "r") as file: only_github_msgram = json.load(file) @@ -33,33 +30,12 @@ "config, expected_result", [ (config, True), - (all_config, True), - (only_github_msgram, False), - ({}, False), - ({"characteristics": []}, False), - ({"characteristics": [{"subcharacteristics": []}]}, False), - ({"characteristics": [{"subcharacteristics": [{"measures": []}]}]}, False), - ], -) -def test_should_process_sonar_metrics(config, expected_result): - result = should_process_sonar_metrics(config) - assert result == expected_result - - -@pytest.mark.parametrize( - "config, expected_result", - [ - (config, False), - (all_config, True), + (only_sonar_msgram, True), (only_github_msgram, True), - ({}, False), - ({"characteristics": []}, False), - ({"characteristics": [{"subcharacteristics": []}]}, False), - ({"characteristics": [{"subcharacteristics": [{"measures": []}]}]}, False), ], ) -def test_should_process_github_metrics(config, expected_result): - result = should_process_github_metrics(config) +def test_should_process_metrics(config, expected_result): + result = should_process_metrics(config) assert result == expected_result @@ -84,53 +60,30 @@ def test_read_msgram(): assert read_msgram(nonexistent_file_path) is False -def test_process_github_metrics(): - result = process_github_metrics(TEST_DATA_DIR, [], {"sonar": [], "github": []}) - assert result is False - - folder_path = TEST_DATA_DIR - github_file_name = "github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram" - - metrics = {"sonar": ["some_metric"], "github": ["resolved_issues", "total_issues"]} - - result = process_github_metrics( - folder_path, [github_file_name, github_file_name], metrics - ) - - expected_result = ( - github_file_name, - [ - {"metric": "resolved_issues", "value": 25}, - {"metric": "total_issues", "value": 30}, - ], - ) - assert result[0] == expected_result - assert result[1] == expected_result - - -def test_process_sonar_metrics(): +@pytest.mark.parametrize( + "input_format, expected_result", + [("github", True), ("sonar", True)], +) +def test_process_metrics(input_format, expected_result): with tempfile.TemporaryDirectory() as temp_dir: - sonar_file_name = "fga-eps-mds-2022-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram" - sonar_file_path = os.path.join(temp_dir, sonar_file_name) - - github_file_name = "github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram" - github_file_path = os.path.join(temp_dir, github_file_name) - - sonar_data = {"sonar_metric": 42} - github_data = {"github_metrics": [{"metric": "resolved_issues", "value": 25}]} + if input_format == "github": + file_name = "github_nlohmann-json-19-11-2023-12-53-58-extracted.msgram" + file_path = os.path.join(temp_dir, file_name) + data = {"github_metrics": [{"metric": "resolved_issues", "value": 25}]} + else: + file_name = "fga-eps-mds-2022-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram" + file_path = os.path.join(temp_dir, file_name) + data = {"sonar_metric": 42} - with open(sonar_file_path, "w") as sonar_file: - json.dump(sonar_data, sonar_file) + with open(file_path, "w") as sonar_file: + json.dump(data, sonar_file) - with open(github_file_path, "w") as github_file: - json.dump(github_data, github_file) + result = process_metrics(temp_dir, [file_name]) + expected_result = [(file_name, data)] - result = process_sonar_metrics(temp_dir, [sonar_file_name], [github_file_name]) - expected_result = [(sonar_file_name, sonar_data)] assert result == expected_result - assert os.path.exists(sonar_file_path) - assert os.path.exists(github_file_path) + assert os.path.exists(file_path) def test_save_metrics(): @@ -149,40 +102,63 @@ def test_save_metrics(): assert saved_metrics == metrics -def test_aggregate_metrics(): +@pytest.mark.parametrize( + "input_format, expected_result", + [ + ( + "github", + { + "github_metrics": [ + {"metric": "resolved_issues", "value": 6.0}, + {"metric": "total_issues", "value": 1.0}, + {"metric": "sum_ci_feedback_times", "value": 925.0}, + {"metric": "total_builds", "value": 30.0}, + ] + }, + ), + ("sonar", {"some_metric": 42}), + ], +) +def test_aggregate_metrics(input_format, expected_result): with tempfile.TemporaryDirectory() as temp_dir: folder_path = temp_dir - msgram_file1 = os.path.join( - folder_path, - "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram", - ) - msgram_file2 = os.path.join( - folder_path, - "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", - ) - - with open(msgram_file1, "w") as file: - json.dump({"some_metric": 42}, file) - - with open(msgram_file2, "w") as file: - json.dump( - { - "github_metrics": [ - {"metric": "resolved_issues", "value": 25}, - {"metric": "total_issues", "value": 30}, - ] - }, - file, + if input_format == "github": + msgram_file = os.path.join( + folder_path, + "github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.msgram", + ) + with open(msgram_file, "w") as file: + json.dump( + { + "github_metrics": [ + {"metric": "resolved_issues", "value": 6.0}, + {"metric": "total_issues", "value": 1.0}, + {"metric": "sum_ci_feedback_times", "value": 925.0}, + {"metric": "total_builds", "value": 30.0}, + ] + }, + file, + ) + else: + msgram_file = os.path.join( + folder_path, + "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.msgram", ) + with open(msgram_file, "w") as file: + json.dump({"some_metric": 42}, file) - result = aggregate_metrics(folder_path, all_config) + result = aggregate_metrics(input_format, folder_path, config) assert result is True output_file_path = os.path.join( folder_path, - "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics", + ( + "github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics" + if input_format == "github" + else "fga-eps-mds-2023-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics" + ), ) assert os.path.exists(output_file_path) @@ -190,34 +166,4 @@ def test_aggregate_metrics(): with open(output_file_path, "r") as output_file: saved_metrics = json.load(output_file) - expected_metrics = { - "some_metric": 42, - "github_metrics": [ - {"metric": "resolved_issues", "value": 25}, - {"metric": "total_issues", "value": 30}, - {"metric": "sum_ci_feedback_times", "value": None}, - {"metric": "total_builds", "value": None}, - ], - } - assert saved_metrics == expected_metrics - - -def test_find_common_part(): - sonar_filename = "fga-eps-mds-2023-2-MeasureSoftGram-Parser-02-06-2023-21-40-30-develop-extracted" - github_files = [ - ( - "github_fga-eps-mds-2023-2-MeasureSoftGram-Parser-09-12-2023-01-24-36-extracted.msgram", - "Metrics1", - ), - ( - "github_fga-eps-mds-2023-2-MeasureSoftGram-CLI-09-12-2023-01-24-36-extracted.msgram", - "Metrics2", - ), - ] - - with patch( - "builtins.print" - ): # Mocking the print function to avoid print statements during testing - result = find_common_part(sonar_filename, github_files) - - assert result == "Metrics1" + assert saved_metrics == expected_result From 271403cf2193a4a62fec699b30ce4184318c71a6 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 00:21:21 -0300 Subject: [PATCH 34/52] fix: adjust lint of cmd extract file --- src/cli/commands/cmd_extract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index cc5232f4..d7bc7494 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows.split(',') if workflows else "build", + "workflows": workflows.split(",") if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( From 5e10551c61c09fa994e3ffb11b7afc9b974feaef Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 01:12:53 -0300 Subject: [PATCH 35/52] refactor: rename norm_diff command --- src/cli/parsers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 253231cb..f04cf66d 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -180,9 +180,9 @@ def create_parser(): ) parser_calculate.set_defaults(func=command_calculate) # function command calculate - # =====================================< COMMAND norm-diff >===================================== + # =====================================< COMMAND norm_diff >===================================== parser_norm_diff = subparsers.add_parser( - "norm-diff", + "norm_diff", help="Calculate the norm difference between the planned metrics and the developed.", ) From 4955f1d86f4269f724ab8f3b69cbf4cc6e05baf2 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 01:13:33 -0300 Subject: [PATCH 36/52] fix: adjust message of norm_diff --- src/cli/commands/cmd_norm_diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 83979041..6bcfdcc2 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -57,7 +57,7 @@ def command_norm_diff(args): norm_diff_value = norm_diff(planned_vector, calculated_vector) print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]") - print_info("[#A9A9A9]For more detailed informations use 'diff' command.[/]") + print_info("[#A9A9A9]For more detailed information use 'diff' command.[/]\n") print(f"Norm Diff: {norm_diff_value}") print_rule() From 55751e5855bd68924ed08cb117db55f5b277f18a Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 01:14:39 -0300 Subject: [PATCH 37/52] refactor: change norm_diff parameter and help instructions --- src/cli/commands/cmd_norm_diff.py | 8 ++++---- src/cli/parsers.py | 12 ++++++------ tests/unit/test_norm_diff.py | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 6bcfdcc2..ce9e30b9 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -43,15 +43,15 @@ def read_calculated_file(file_path): def command_norm_diff(args): try: - planned_path = args["planned_path"] - calculated_path = args["calculated_path"] + rp_path = args["rp_path"] + rd_path = args["rd_path"] except KeyError as e: logger.error(f"KeyError: args[{e}] - non-existent parameters") print_error(f"KeyError: args[{e}] - non-existent parameters") exit(1) - planned_data = read_planned_file(planned_path, sort_key="key") - calculated_data = read_calculated_file(calculated_path) + planned_data = read_planned_file(rp_path, sort_key="key") + calculated_data = read_calculated_file(rd_path) planned_vector, calculated_vector = extract_values(planned_data, calculated_data) norm_diff_value = norm_diff(planned_vector, calculated_vector) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index f04cf66d..d21d8379 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -187,17 +187,17 @@ def create_parser(): ) parser_norm_diff.add_argument( - "-p", - "--planned_path", + "-rp", + "--rp_path", type=lambda p: Path(p).absolute(), - help="Path to the json with the planned metrics.", + help="Path to the .json file with the planned/wished values ​​for the quality characteristics of a release. Quality requirements goals for a release.", ) parser_norm_diff.add_argument( - "-c", - "--calculated_path", + "-rd", + "--rd_path", type=lambda p: Path(p).absolute(), - help="Path to the json with the calculated metrics.", + help="Path to the .json file with the model-calculated values ​​for a release's quality characteristics observed/developed.", ) parser_norm_diff.set_defaults( diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index 29f24918..f680fffe 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -19,8 +19,8 @@ def test_norm_diff(): command_norm_diff( { - "planned_path": Path(config_dirpath) / "planned.json", - "calculated_path": Path(config_dirpath) / "calculated.json", + "rp_path": Path(config_dirpath) / "planned.json", + "rd_path": Path(config_dirpath) / "calculated.json", } ) @@ -45,7 +45,7 @@ def test_missing_args(): shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: - command_norm_diff({"planned_path": Path(config_dirpath) / "planned.json"}) + command_norm_diff({"rp_path": Path(config_dirpath) / "planned.json"}) sys.stdout = sys.__stdout__ @@ -67,8 +67,8 @@ def test_invalid_calculated_file(): with pytest.raises(SystemExit) as excinfo: command_norm_diff( { - "planned_path": Path(config_dirpath) / "planned.json", - "calculated_path": Path(config_dirpath) / "invalid.json", + "rp_path": Path(config_dirpath) / "planned.json", + "rd_path": Path(config_dirpath) / "invalid.json", } ) @@ -92,8 +92,8 @@ def test_invalid_planned_file(): with pytest.raises(SystemExit) as excinfo: command_norm_diff( { - "planned_path": Path(config_dirpath) / "invalid.json", - "calculated_path": Path(config_dirpath) / "calculated.json", + "rp_path": Path(config_dirpath) / "invalid.json", + "rd_path": Path(config_dirpath) / "calculated.json", } ) @@ -120,8 +120,8 @@ def test_missmatch_values(): with pytest.raises(SystemExit) as excinfo: command_norm_diff( { - "planned_path": Path(config_dirpath) / "missmatch-planned.json", - "calculated_path": Path(config_dirpath) / "calculated.json", + "rp_path": Path(config_dirpath) / "missmatch-planned.json", + "rd_path": Path(config_dirpath) / "calculated.json", } ) From 00419dec1fa9df78f06571a00e46991c7476d256 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 03:03:56 -0300 Subject: [PATCH 38/52] chore: add message to interpret norm diff value --- src/cli/commands/cmd_norm_diff.py | 4 ++-- tests/unit/test_norm_diff.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index ce9e30b9..330b5082 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -56,8 +56,8 @@ def command_norm_diff(args): planned_vector, calculated_vector = extract_values(planned_data, calculated_data) norm_diff_value = norm_diff(planned_vector, calculated_vector) - print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]") - print_info("[#A9A9A9]For more detailed information use 'diff' command.[/]\n") + print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]\n") + print_info("[#A9A9A9]The norm_diff value indicates the difference between the observed quality (Rd) and the planned target (Rp). A norm_diff of 0 means that the observed quality perfectly aligns with the planned target. If norm_diff is not equal to 0, it shows a deviation from the target. In this case, you should determine whether the performance is above or below the planned quality. For a detailed analysis of these differences, use the msgram diff command.[/]\n") print(f"Norm Diff: {norm_diff_value}") print_rule() diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index f680fffe..daf7fd43 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -29,7 +29,7 @@ def test_norm_diff(): output = captured_output.getvalue() assert "Norm diff calculation performed successfully!" in output - assert "For more detailed informations use 'diff' command." in output + assert "The norm_diff value indicates the difference between the observed quality (Rd) and the planned target (Rp)." in output norm_diff_value = float(output.split("Norm Diff:")[1].split("\n")[0].strip()) assert norm_diff_value == 0.24323122001478284 From 833320cc7247509495798aa4a688bcccf94e9bed Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 03:05:21 -0300 Subject: [PATCH 39/52] chore: add treatment to invalid values in planned and developed files --- src/cli/commands/cmd_norm_diff.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 330b5082..f81eb326 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -53,7 +53,7 @@ def command_norm_diff(args): planned_data = read_planned_file(rp_path, sort_key="key") calculated_data = read_calculated_file(rd_path) - planned_vector, calculated_vector = extract_values(planned_data, calculated_data) + planned_vector, calculated_vector = extract_values(planned_data, calculated_data, rp_path, rd_path) norm_diff_value = norm_diff(planned_vector, calculated_vector) print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]\n") @@ -62,7 +62,7 @@ def command_norm_diff(args): print_rule() -def extract_values(planned_data, calculated_data): +def extract_values(planned_data, calculated_data, rp_path, rd_path): try: planned = planned_data calculated = [] @@ -86,6 +86,18 @@ def extract_values(planned_data, calculated_data): planned_values = [planned_dict[key] for key in planned_keys] calculated_values = [calculated_dict[key] for key in planned_keys] + for value in planned_values: + if value > 1: + print_error(f"[red]The values informed in the .json file {rp_path} must be between 0 and 1.\n") + print_rule() + exit(1) + + for value in calculated_values: + if value > 1: + print_error(f"[red]The values informed in the .json file {rd_path} must be between 0 and 1.\n") + print_rule() + exit(1) + return (np.array(planned_values), np.array(calculated_values)) except exceptions.MeasureSoftGramCLIException as e: print_error(f"[red]Error extracting values: {e}\n") From a851667a4d4405c11013f3ba5d76bc429fa69dc9 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 03:22:54 -0300 Subject: [PATCH 40/52] test: add tests to verify treatment of values biggers than one in planned or developed file --- tests/unit/data/calculated-bigger-value.json | 52 ++++++++++++++++++++ tests/unit/data/planned-bigger-value.json | 10 ++++ tests/unit/test_norm_diff.py | 49 ++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 tests/unit/data/calculated-bigger-value.json create mode 100644 tests/unit/data/planned-bigger-value.json diff --git a/tests/unit/data/calculated-bigger-value.json b/tests/unit/data/calculated-bigger-value.json new file mode 100644 index 00000000..43df61ec --- /dev/null +++ b/tests/unit/data/calculated-bigger-value.json @@ -0,0 +1,52 @@ +[ + { + "repository": [ + { + "key": "repository", + "value": "Example Repository" + } + ], + "version": [ + { + "key": "version", + "value": "27-07-2024-21-40" + } + ], + "measures": [ + { + "key": "first_measure", + "value": 1.0 + }, + { + "key": "second_measure", + "value": 0.9996066627522133 + } + ], + "subcharacteristics": [ + { + "key": "first_subcharacteristics", + "value": 0.8421061048464034 + }, + { + "key": "second_subcharacteristics", + "value": 0.6415437113263573 + } + ], + "characteristics": [ + { + "key": "first_characteristics", + "value": 0.8421061048464034 + }, + { + "key": "second_characteristics", + "value": 3.6415437113263573 + } + ], + "tsqmi": [ + { + "key": "tsqmi", + "value": 0.7485723162667646 + } + ] + } +] \ No newline at end of file diff --git a/tests/unit/data/planned-bigger-value.json b/tests/unit/data/planned-bigger-value.json new file mode 100644 index 00000000..bc6770cf --- /dev/null +++ b/tests/unit/data/planned-bigger-value.json @@ -0,0 +1,10 @@ +[ + { + "key": "first_characteristics", + "value": 0.95 + }, + { + "key": "second_characteristics ", + "value": 3.95 + } + ] \ No newline at end of file diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index daf7fd43..98143716 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -131,3 +131,52 @@ def test_missmatch_values(): assert excinfo.value.code == 1 assert "Error extracting values" in output + +def test_planned_value_bigger_than_one(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned-bigger-value.json", f"{config_dirpath}/planned-bigger-value.json") + shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff( + { + "rp_path": Path(config_dirpath) / "planned-bigger-value.json", + "rd_path": Path(config_dirpath) / "calculated.json", + } + ) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "The values informed in the .json" in output + + +def test_developed_value_bigger_than_one(): + config_dirpath = tempfile.mkdtemp() + + captured_output = StringIO() + sys.stdout = captured_output + + shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") + shutil.copy("tests/unit/data/calculated-bigger-value.json", f"{config_dirpath}/calculated-bigger-value.json") + + with pytest.raises(SystemExit) as excinfo: + command_norm_diff( + { + "rp_path": Path(config_dirpath) / "planned.json", + "rd_path": Path(config_dirpath) / "calculated-bigger-value.json", + } + ) + + sys.stdout = sys.__stdout__ + + output = captured_output.getvalue() + + assert excinfo.value.code == 1 + assert "The values informed in the .json" in output \ No newline at end of file From 265dfe3454e0918f8a5b0bd4361de75d91aa68ba Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 03:25:52 -0300 Subject: [PATCH 41/52] fix: verify values lower than zero either in norm diff values verification --- src/cli/commands/cmd_norm_diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index f81eb326..1c1add69 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -87,13 +87,13 @@ def extract_values(planned_data, calculated_data, rp_path, rd_path): calculated_values = [calculated_dict[key] for key in planned_keys] for value in planned_values: - if value > 1: + if value > 1 or value < 0: print_error(f"[red]The values informed in the .json file {rp_path} must be between 0 and 1.\n") print_rule() exit(1) for value in calculated_values: - if value > 1: + if value > 1 or value < 0: print_error(f"[red]The values informed in the .json file {rd_path} must be between 0 and 1.\n") print_rule() exit(1) From 9c03c2f2776427cee781f29b102c264bfb355656 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 13:11:58 -0300 Subject: [PATCH 42/52] =?UTF-8?q?tests(bug/008):=20testes=20para=20c=C3=A1?= =?UTF-8?q?lculo=20separado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_calculate.py | 7 +- src/cli/commands/cmd_extract.py | 2 +- ...11-2023-02-57-52-develop-extracted.metrics | 7584 +++++++++++++++++ ...-11-2023-02-57-52-develop-extracted.msgram | 7584 +++++++++++++++++ tests/unit/test_calculate.py | 137 +- tests/unit/test_jsonReader.py | 4 +- tests/unit/test_parser.py | 2 + 7 files changed, 15265 insertions(+), 55 deletions(-) create mode 100644 tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.metrics create mode 100644 tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.msgram diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 73d0e748..d72de5dd 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -54,11 +54,10 @@ def calculate_metrics(input_format, extracted_path, config): return data_calculated, True else: try: + file_name = extracted_path.name if extracted_path.name.startswith("github_"): - extracted_path.name = extracted_path.name[len("github_") :] - result = calculate_all( - open_json_file(extracted_path), extracted_path.name, config - ) + file_name = file_name[len("github_") :] + result = calculate_all(open_json_file(extracted_path), file_name, config) return result, True except exceptions.MeasureSoftGramCLIException as e: print_error(f"[red]Error calculating {extracted_path}: {e}\n") diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 0bffb71d..6a7d9eb5 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows.split(',') if workflows else "build", + "workflows": workflows.split(",") if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( diff --git a/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.metrics b/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.metrics new file mode 100644 index 00000000..79a3e2f6 --- /dev/null +++ b/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.metrics @@ -0,0 +1,7584 @@ +{ + "fga-eps-mds_2023-2-MeasureSoftGram-Service": [ + { + "metric": "comment_lines_density", + "value": "10.1" + }, + { + "metric": "complexity", + "value": "558" + }, + { + "metric": "coverage", + "value": "80.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "149" + }, + { + "metric": "functions", + "value": "315" + }, + { + "metric": "ncloc", + "value": "7112" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "14909" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "115" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "48" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "0.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "139" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/models.py": [ + { + "metric": "comment_lines_density", + "value": "5.4" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "75.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "87" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "18" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "78" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "4638" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "16" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/urls.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "53" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/views.py": [ + { + "metric": "comment_lines_density", + "value": "28.4" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "53" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "1.2" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "84.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "84" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0002_balancematrix.py": [ + { + "metric": "comment_lines_density", + "value": "2.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "50" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0003_calculatedcharacteristic_release.py": [ + { + "metric": "comment_lines_density", + "value": "4.8" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "20" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0004_alter_calculatedcharacteristic_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "5.9" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "16" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0005_alter_calculatedcharacteristic_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "5.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "19" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/models.py": [ + { + "metric": "comment_lines_density", + "value": "29.0" + }, + { + "metric": "complexity", + "value": "14" + }, + { + "metric": "coverage", + "value": "93.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "120" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "19.4" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "79.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "108" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/views.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "11" + }, + { + "metric": "coverage", + "value": "97.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "7" + }, + { + "metric": "ncloc", + "value": "167" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/__init__.py": [ + { + "metric": "comment_lines_density", + "value": "18.3" + }, + { + "metric": "complexity", + "value": "40" + }, + { + "metric": "coverage", + "value": "21.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "13" + }, + { + "metric": "ncloc", + "value": "187" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "26.1" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "59.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "68" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/utils.py": [ + { + "metric": "comment_lines_density", + "value": "8.9" + }, + { + "metric": "complexity", + "value": "8" + }, + { + "metric": "coverage", + "value": "21.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "41" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/view.py": [ + { + "metric": "comment_lines_density", + "value": "11.1" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "41.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "64" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "37.5" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "5" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/utils.py": [ + { + "metric": "comment_lines_density", + "value": "15.6" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "81.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "38" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/view.py": [ + { + "metric": "comment_lines_density", + "value": "13.8" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "70.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "25" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/asgi.py": [ + { + "metric": "comment_lines_density", + "value": "66.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/settings.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "1" + }, + { + "metric": "coverage", + "value": "94.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "381" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/urls.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "96.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "51" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/wsgi.py": [ + { + "metric": "comment_lines_density", + "value": "66.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "11.4" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "95.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "70" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/views.py": [ + { + "metric": "comment_lines_density", + "value": "25.0" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "87.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "42" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "9" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "50" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0002_alter_goal_created_by.py": [ + { + "metric": "comment_lines_density", + "value": "6.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "14" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0003_alter_goal_created_by.py": [ + { + "metric": "comment_lines_density", + "value": "5.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "18" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0004_remove_goal_end_at_remove_goal_release_name_and_more.py": [ + { + "metric": "comment_lines_density", + "value": "5.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "19" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/models.py": [ + { + "metric": "comment_lines_density", + "value": "12.7" + }, + { + "metric": "complexity", + "value": "12" + }, + { + "metric": "coverage", + "value": "95.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "117" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "16.9" + }, + { + "metric": "complexity", + "value": "19" + }, + { + "metric": "coverage", + "value": "97.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "12" + }, + { + "metric": "ncloc", + "value": "123" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/tests/test_goal_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1900" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "9" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/views.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "11" + }, + { + "metric": "coverage", + "value": "83.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "84" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/manage.py": [ + { + "metric": "comment_lines_density", + "value": "16.7" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "15" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/admin.py": [ + { + "metric": "comment_lines_density", + "value": "6.3" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "77.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "74" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/models.py": [ + { + "metric": "comment_lines_density", + "value": "36.0" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "91.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "57" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "21.7" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "76.4" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "90" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/views.py": [ + { + "metric": "comment_lines_density", + "value": "16.8" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "98.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "124" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "75.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "54" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "0.9" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "107" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/0002_alter_collectedmetric_repository.py": [ + { + "metric": "comment_lines_density", + "value": "5.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "18" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/models.py": [ + { + "metric": "comment_lines_density", + "value": "26.9" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "94.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "117" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "67.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/views.py": [ + { + "metric": "comment_lines_density", + "value": "31.3" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "57" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "37" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/load_initial_data.py": [ + { + "metric": "comment_lines_density", + "value": "3.5" + }, + { + "metric": "complexity", + "value": "55" + }, + { + "metric": "coverage", + "value": "42.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "30" + }, + { + "metric": "ncloc", + "value": "502" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/utils.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "19" + }, + { + "metric": "coverage", + "value": "75.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "10" + }, + { + "metric": "ncloc", + "value": "132" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "101" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0002_organization_admin.py": [ + { + "metric": "comment_lines_density", + "value": "4.5" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "21" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0003_alter_repository_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0004_alter_organization_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0005_alter_repository_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0005_product_gaugeredlimit_product_gaugeyellowlimit.py": [ + { + "metric": "comment_lines_density", + "value": "4.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "22" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0006_repository_url.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0007_repository_platform.py": [ + { + "metric": "comment_lines_density", + "value": "3.8" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "25" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0008_alter_repository_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0009_alter_repository_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0010_alter_repository_platform.py": [ + { + "metric": "comment_lines_density", + "value": "3.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "26" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0011_merge_20231209_1347.py": [ + { + "metric": "comment_lines_density", + "value": "9.1" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "10" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "88.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "108" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/organizations.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "1" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "17" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/products.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "88" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/repos.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "140" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/routers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "21" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.6" + }, + { + "metric": "complexity", + "value": "30" + }, + { + "metric": "coverage", + "value": "90.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "20" + }, + { + "metric": "ncloc", + "value": "414" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_organizations_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2064" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "10" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_products_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2100" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "21" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_repositories_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2072" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "30" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/views.py": [ + { + "metric": "comment_lines_density", + "value": "3.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "9" + }, + { + "metric": "ncloc", + "value": "97" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.2" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "44" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/models.py": [ + { + "metric": "comment_lines_density", + "value": "23.0" + }, + { + "metric": "complexity", + "value": "53" + }, + { + "metric": "coverage", + "value": "86.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "18" + }, + { + "metric": "ncloc", + "value": "251" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.1" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "88.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "34" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1041" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "3" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/views.py": [ + { + "metric": "comment_lines_density", + "value": "1.4" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "97.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "68" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "77.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "9" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/jobs.py": [ + { + "metric": "comment_lines_density", + "value": "2.8" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "104" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.6" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "62" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/0002_alter_release_table.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/models.py": [ + { + "metric": "comment_lines_density", + "value": "11.1" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "24" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "88.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "87" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/service.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "85.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "42" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/tests/test_releases_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1024" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "17" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/views.py": [ + { + "metric": "comment_lines_density", + "value": "0.8" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "96.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "125" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "1.4" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "82.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "73" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/models.py": [ + { + "metric": "comment_lines_density", + "value": "32.7" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "92.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "72" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "19.5" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "76.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "95" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/views.py": [ + { + "metric": "comment_lines_density", + "value": "8.9" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "96.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "133" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tmp.json": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.4" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "40" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/0002_alter_tsqmi_options.py": [ + { + "metric": "comment_lines_density", + "value": "6.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "15" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/models.py": [ + { + "metric": "comment_lines_density", + "value": "17.6" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "14" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "15.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "17" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/views.py": [ + { + "metric": "comment_lines_density", + "value": "3.2" + }, + { + "metric": "complexity", + "value": "12" + }, + { + "metric": "coverage", + "value": "71.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "11" + }, + { + "metric": "ncloc", + "value": "152" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/__init__.py": [ + { + "metric": "comment_lines_density", + "value": "12.1" + }, + { + "metric": "complexity", + "value": "27" + }, + { + "metric": "coverage", + "value": "94.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "14" + }, + { + "metric": "ncloc", + "value": "131" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/decorators.py": [ + { + "metric": "comment_lines_density", + "value": "43.5" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "76.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "13" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/exceptions.py": [ + { + "metric": "comment_lines_density", + "value": "13.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "26" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/managers.py": [ + { + "metric": "comment_lines_density", + "value": "19.5" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "33" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/mocks.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "58.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "9" + }, + { + "metric": "ncloc", + "value": "43" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/tests/test_utils_methods_and_functions.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "70" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "9" + } + ] +} \ No newline at end of file diff --git a/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.msgram b/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.msgram new file mode 100644 index 00000000..e6b6da9b --- /dev/null +++ b/tests/unit/data/fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.msgram @@ -0,0 +1,7584 @@ +{ + "fga-eps-mds_2023-2-MeasureSoftGram-Service": [ + { + "metric": "comment_lines_density", + "value": "10.1" + }, + { + "metric": "complexity", + "value": "558" + }, + { + "metric": "coverage", + "value": "80.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "149" + }, + { + "metric": "functions", + "value": "315" + }, + { + "metric": "ncloc", + "value": "7112" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "14909" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "115" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "48" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "0.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "139" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/models.py": [ + { + "metric": "comment_lines_density", + "value": "5.4" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "75.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "87" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "18" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "78" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "4638" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "16" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/urls.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "53" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/accounts/views.py": [ + { + "metric": "comment_lines_density", + "value": "28.4" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "53" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "1.2" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "84.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "84" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0002_balancematrix.py": [ + { + "metric": "comment_lines_density", + "value": "2.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "50" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0003_calculatedcharacteristic_release.py": [ + { + "metric": "comment_lines_density", + "value": "4.8" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "20" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0004_alter_calculatedcharacteristic_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "5.9" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "16" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/0005_alter_calculatedcharacteristic_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "5.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "19" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/models.py": [ + { + "metric": "comment_lines_density", + "value": "29.0" + }, + { + "metric": "complexity", + "value": "14" + }, + { + "metric": "coverage", + "value": "93.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "120" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "19.4" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "79.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "108" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/characteristics/views.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "11" + }, + { + "metric": "coverage", + "value": "97.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "7" + }, + { + "metric": "ncloc", + "value": "167" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/__init__.py": [ + { + "metric": "comment_lines_density", + "value": "18.3" + }, + { + "metric": "complexity", + "value": "40" + }, + { + "metric": "coverage", + "value": "21.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "13" + }, + { + "metric": "ncloc", + "value": "187" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "26.1" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "59.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "68" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/utils.py": [ + { + "metric": "comment_lines_density", + "value": "8.9" + }, + { + "metric": "complexity", + "value": "8" + }, + { + "metric": "coverage", + "value": "21.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "41" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/github/view.py": [ + { + "metric": "comment_lines_density", + "value": "11.1" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "41.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "64" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "37.5" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "5" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/utils.py": [ + { + "metric": "comment_lines_density", + "value": "15.6" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "81.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "38" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/collectors/sonarqube/view.py": [ + { + "metric": "comment_lines_density", + "value": "13.8" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "70.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "25" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/asgi.py": [ + { + "metric": "comment_lines_density", + "value": "66.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/settings.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "1" + }, + { + "metric": "coverage", + "value": "94.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "381" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/urls.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "96.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "51" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/config/wsgi.py": [ + { + "metric": "comment_lines_density", + "value": "66.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "11.4" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "95.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "70" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/entity_trees/views.py": [ + { + "metric": "comment_lines_density", + "value": "25.0" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "87.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "42" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "9" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "50" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0002_alter_goal_created_by.py": [ + { + "metric": "comment_lines_density", + "value": "6.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "14" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0003_alter_goal_created_by.py": [ + { + "metric": "comment_lines_density", + "value": "5.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "18" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/0004_remove_goal_end_at_remove_goal_release_name_and_more.py": [ + { + "metric": "comment_lines_density", + "value": "5.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "19" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/models.py": [ + { + "metric": "comment_lines_density", + "value": "12.7" + }, + { + "metric": "complexity", + "value": "12" + }, + { + "metric": "coverage", + "value": "95.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "117" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "16.9" + }, + { + "metric": "complexity", + "value": "19" + }, + { + "metric": "coverage", + "value": "97.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "12" + }, + { + "metric": "ncloc", + "value": "123" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/tests/test_goal_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1900" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "9" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/goals/views.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "11" + }, + { + "metric": "coverage", + "value": "83.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "8" + }, + { + "metric": "ncloc", + "value": "84" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/manage.py": [ + { + "metric": "comment_lines_density", + "value": "16.7" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "15" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/admin.py": [ + { + "metric": "comment_lines_density", + "value": "6.3" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "77.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "74" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/models.py": [ + { + "metric": "comment_lines_density", + "value": "36.0" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "91.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "57" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "21.7" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "76.4" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "90" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/measures/views.py": [ + { + "metric": "comment_lines_density", + "value": "16.8" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "98.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "124" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "75.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "54" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "0.9" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "107" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/0002_alter_collectedmetric_repository.py": [ + { + "metric": "comment_lines_density", + "value": "5.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "18" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/models.py": [ + { + "metric": "comment_lines_density", + "value": "26.9" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "94.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "117" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "67.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/metrics/views.py": [ + { + "metric": "comment_lines_density", + "value": "31.3" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "57" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "37" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/load_initial_data.py": [ + { + "metric": "comment_lines_density", + "value": "3.5" + }, + { + "metric": "complexity", + "value": "55" + }, + { + "metric": "coverage", + "value": "42.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "30" + }, + { + "metric": "ncloc", + "value": "502" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/management/commands/utils.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "19" + }, + { + "metric": "coverage", + "value": "75.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "10" + }, + { + "metric": "ncloc", + "value": "132" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "101" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0002_organization_admin.py": [ + { + "metric": "comment_lines_density", + "value": "4.5" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "21" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0003_alter_repository_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0004_alter_organization_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0005_alter_repository_key.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0005_product_gaugeredlimit_product_gaugeyellowlimit.py": [ + { + "metric": "comment_lines_density", + "value": "4.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "22" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0006_repository_url.py": [ + { + "metric": "comment_lines_density", + "value": "7.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0007_repository_platform.py": [ + { + "metric": "comment_lines_density", + "value": "3.8" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "25" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0008_alter_repository_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0009_alter_repository_unique_together.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0010_alter_repository_platform.py": [ + { + "metric": "comment_lines_density", + "value": "3.7" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "26" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/0011_merge_20231209_1347.py": [ + { + "metric": "comment_lines_density", + "value": "9.1" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "10" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/models.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "88.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "108" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/organizations.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "1" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "17" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/products.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "88" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/repos.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "140" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/routers/routers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "21" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.6" + }, + { + "metric": "complexity", + "value": "30" + }, + { + "metric": "coverage", + "value": "90.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "20" + }, + { + "metric": "ncloc", + "value": "414" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_organizations_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2064" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "10" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_products_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2100" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "21" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/tests/test_repositories_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "2072" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "30" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/organizations/views.py": [ + { + "metric": "comment_lines_density", + "value": "3.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "9" + }, + { + "metric": "ncloc", + "value": "97" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "12" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.2" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "44" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/models.py": [ + { + "metric": "comment_lines_density", + "value": "23.0" + }, + { + "metric": "complexity", + "value": "53" + }, + { + "metric": "coverage", + "value": "86.3" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "18" + }, + { + "metric": "ncloc", + "value": "251" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "8.1" + }, + { + "metric": "complexity", + "value": "3" + }, + { + "metric": "coverage", + "value": "88.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "34" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1041" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "3" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/pre_configs/views.py": [ + { + "metric": "comment_lines_density", + "value": "1.4" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "97.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "68" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "2" + }, + { + "metric": "coverage", + "value": "77.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "1" + }, + { + "metric": "ncloc", + "value": "9" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/jobs.py": [ + { + "metric": "comment_lines_density", + "value": "2.8" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "0.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "104" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.6" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "62" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/0002_alter_release_table.py": [ + { + "metric": "comment_lines_density", + "value": "8.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/models.py": [ + { + "metric": "comment_lines_density", + "value": "11.1" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "24" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "88.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "87" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/service.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "85.2" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "42" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/tests/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/tests/test_releases_endpoints.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "1024" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "17" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/releases/views.py": [ + { + "metric": "comment_lines_density", + "value": "0.8" + }, + { + "metric": "complexity", + "value": "10" + }, + { + "metric": "coverage", + "value": "96.7" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "125" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/admin.py": [ + { + "metric": "comment_lines_density", + "value": "1.4" + }, + { + "metric": "complexity", + "value": "5" + }, + { + "metric": "coverage", + "value": "82.1" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "73" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "1.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "77" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/models.py": [ + { + "metric": "comment_lines_density", + "value": "32.7" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "92.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "6" + }, + { + "metric": "ncloc", + "value": "72" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "19.5" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "76.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "3" + }, + { + "metric": "ncloc", + "value": "95" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/subcharacteristics/views.py": [ + { + "metric": "comment_lines_density", + "value": "8.9" + }, + { + "metric": "complexity", + "value": "7" + }, + { + "metric": "coverage", + "value": "96.5" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "5" + }, + { + "metric": "ncloc", + "value": "133" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tmp.json": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/admin.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "11" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/0001_initial.py": [ + { + "metric": "comment_lines_density", + "value": "2.4" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "40" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/0002_alter_tsqmi_options.py": [ + { + "metric": "comment_lines_density", + "value": "6.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "15" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/migrations/__init__.py": [ + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/models.py": [ + { + "metric": "comment_lines_density", + "value": "17.6" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "14" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/serializers.py": [ + { + "metric": "comment_lines_density", + "value": "15.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "17" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/tsqmi/views.py": [ + { + "metric": "comment_lines_density", + "value": "3.2" + }, + { + "metric": "complexity", + "value": "12" + }, + { + "metric": "coverage", + "value": "71.6" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "11" + }, + { + "metric": "ncloc", + "value": "152" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/__init__.py": [ + { + "metric": "comment_lines_density", + "value": "12.1" + }, + { + "metric": "complexity", + "value": "27" + }, + { + "metric": "coverage", + "value": "94.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "14" + }, + { + "metric": "ncloc", + "value": "131" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/apps.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "4" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/decorators.py": [ + { + "metric": "comment_lines_density", + "value": "43.5" + }, + { + "metric": "complexity", + "value": "4" + }, + { + "metric": "coverage", + "value": "76.9" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "4" + }, + { + "metric": "ncloc", + "value": "13" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/exceptions.py": [ + { + "metric": "comment_lines_density", + "value": "13.3" + }, + { + "metric": "complexity", + "value": "0" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "0" + }, + { + "metric": "ncloc", + "value": "26" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/managers.py": [ + { + "metric": "comment_lines_density", + "value": "19.5" + }, + { + "metric": "complexity", + "value": "6" + }, + { + "metric": "coverage", + "value": "100.0" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "2" + }, + { + "metric": "ncloc", + "value": "33" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/mocks.py": [ + { + "metric": "comment_lines_density", + "value": "0.0" + }, + { + "metric": "complexity", + "value": "9" + }, + { + "metric": "coverage", + "value": "58.8" + }, + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "files", + "value": "1" + }, + { + "metric": "functions", + "value": "9" + }, + { + "metric": "ncloc", + "value": "43" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/tests.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + } + ], + "fga-eps-mds_2023-2-MeasureSoftGram-Service:src/utils/tests/test_utils_methods_and_functions.py": [ + { + "metric": "duplicated_lines_density", + "value": "0.0" + }, + { + "metric": "reliability_rating", + "value": "1.0" + }, + { + "metric": "security_rating", + "value": "1.0" + }, + { + "metric": "test_errors", + "value": "0" + }, + { + "metric": "test_execution_time", + "value": "70" + }, + { + "metric": "test_failures", + "value": "0" + }, + { + "metric": "test_success_density", + "value": "100.0" + }, + { + "metric": "tests", + "value": "9" + } + ] +} \ No newline at end of file diff --git a/tests/unit/test_calculate.py b/tests/unit/test_calculate.py index 36c6228c..d72358b7 100644 --- a/tests/unit/test_calculate.py +++ b/tests/unit/test_calculate.py @@ -14,6 +14,7 @@ from staticfiles import DEFAULT_PRE_CONFIG as pre_config CALCULATE_ARGS = { + "input_format": "github", "output_format": "csv", "config_path": Path(""), "extracted_path": Path(""), @@ -79,7 +80,7 @@ def test_show_tree(capfd): @pytest.mark.parametrize( - "calculate_arg", ["output_format", "config_path", "extracted_path"] + "calculate_arg", ["input_format", "output_format", "config_path", "extracted_path"] ) def test_calculate_invalid_args(calculate_arg): captured_output = StringIO() @@ -99,16 +100,16 @@ def test_calculate_invalid_args(calculate_arg): @pytest.mark.parametrize( - "output_format,multiple_files", + "input_format,output_format,multiple_files", [ - ("tabular", False), - ("tree", False), - ("raw", False), - ("csv", True), - ("json", True), + ("sonar", "tabular", False), + ("sonar", "tree", False), + ("sonar", "raw", False), + ("github", "csv", True), + ("github", "json", True), ], ) -def test_calculate_file(output_format, multiple_files): +def test_calculate_file(input_format, output_format, multiple_files): config_dirpath = tempfile.mkdtemp() extract_dirpath = tempfile.mkdtemp() @@ -121,6 +122,7 @@ def test_calculate_file(output_format, multiple_files): ) args = { + "input_format": input_format, "output_format": output_format, "config_path": Path(config_dirpath), "extracted_path": Path( @@ -140,64 +142,99 @@ def test_calculate_file(output_format, multiple_files): shutil.rmtree(extract_dirpath) -def test_calculate_all_dict(): - file_name = "fga-eps-mds-2022-2-MeasureSoftGram-CLI-01-05-2023-21-40-30-develop-extracted.metrics" +def test_calculate_sonar(): + file_name = "fga-eps-mds-2023-2-MeasureSoftGram-Service-12-11-2023-02-57-52-develop-extracted.metrics" json_data = open_json_file(Path(f"tests/unit/data/{file_name}")) config = open_json_file(Path("tests/unit/data/msgram.json")) calculated_result = calculate_all(json_data, file_name, config) calculate_expected = { "repository": [ - {"key": "repository", "value": "fga-eps-mds-2022-2-MeasureSoftGram-CLI"} + {"key": "repository", "value": "fga-eps-mds-2023-2-MeasureSoftGram-Service"} ], - "version": [{"key": "version", "value": "01-05-2023-21-40"}], + "version": [{"key": "version", "value": "12-11-2023-02-57"}], "measures": [ {"key": "passed_tests", "value": 1.0}, - { - "key": "test_builds", - "value": 0.9996066627522133, - }, - { - "key": "test_coverage", - "value": 0.40234848484848484, - }, - { - "key": "non_complex_file_density", - "value": 0.44347274991556906, - }, - { - "key": "commented_file_density", - "value": 0.04318181818181818, - }, + {"key": "test_builds", "value": 0.9994736632118764}, + {"key": "test_coverage", "value": 0.799465811965812}, + {"key": "non_complex_file_density", "value": 0.29985992940690925}, + {"key": "commented_file_density", "value": 0.12777777777777777}, {"key": "duplication_absense", "value": 1.0}, ], "subcharacteristics": [ - { - "key": "testing_status", - "value": 0.8421061048464034, - }, - { - "key": "modifiability", - "value": 0.6415437113263573, - }, + {"key": "testing_status", "value": 0.9351668104467522}, + {"key": "modifiability", "value": 0.617602903519865}, ], "characteristics": [ - { - "key": "reliability", - "value": 0.8421061048464034, - }, - { - "key": "maintainability", - "value": 0.6415437113263573, - }, + {"key": "reliability", "value": 0.9351668104467522}, + {"key": "maintainability", "value": 0.617602903519865}, ], - "tsqmi": [ - { - "key": "tsqmi", - "value": 0.7485723162667646, - } + "tsqmi": [{"key": "tsqmi", "value": 0.7970842309514055}], + } + assert calculated_result.get("repository") == calculate_expected.get("repository") + assert calculated_result.get("version") == calculate_expected.get("version") + measures_result = calculated_result.get("measures") + measures_expected = calculate_expected.get("measures") + for measure_result, measure_expected in zip(measures_result, measures_expected): + assert measure_result.get("key") == measure_expected.get("key") + assert pytest.approx(measure_result.get("value")) == measure_expected.get( + "value" + ) + + subcharacteristics_result = calculated_result.get("subcharacteristics") + subcharacteristics_expected = calculate_expected.get("subcharacteristics") + for subcharacteristic_result, subcharacteristic_expected in zip( + subcharacteristics_result, subcharacteristics_expected + ): + assert subcharacteristic_result.get("key") == subcharacteristic_expected.get( + "key" + ) + assert pytest.approx( + subcharacteristic_result.get("value") + ) == subcharacteristic_expected.get("value") + + characteristics_result = calculated_result.get("characteristics") + characteristics_expected = calculate_expected.get("characteristics") + for characteristic_result, characteristic_expected in zip( + characteristics_result, characteristics_expected + ): + assert characteristic_result.get("key") == characteristic_expected.get("key") + assert pytest.approx( + characteristic_result.get("value") + ) == characteristic_expected.get("value") + + tsqmi_result = calculated_result.get("tsqmi")[0] + tsqmi_expected = calculate_expected.get("tsqmi")[0] + assert tsqmi_result.get("key") == tsqmi_expected.get("key") + assert pytest.approx(tsqmi_result.get("value")) == tsqmi_expected.get("value") + + +def test_calculate_github(): + file_name = "github_fga-eps-mds-2024.1-MeasureSoftGram-DOC-28-07-2024-00-00-22-extracted.metrics" + json_data = open_json_file(Path(f"tests/unit/data/{file_name}")) + config = open_json_file(Path("tests/unit/data/msgram.json")) + + calculated_result = calculate_all(json_data, file_name[len("github_") :], config) + calculate_expected = { + "repository": [ + {"key": "repository", "value": "fga-eps-mds-2024.1-MeasureSoftGram-DOC"} ], + "version": [{"key": "version", "value": "28-07-2024-00-00"}], + "measures": [ + {"key": "team_throughput", "value": 0.0}, + {"key": "ci_feedback_time", "value": 0.03225806451612903}, + ], + "subcharacteristics": [ + {"key": "maturity", "value": 0.03225806451612903}, + {"key": "functional_completeness", "value": 0.0}, + ], + "characteristics": [ + {"key": "reliability", "value": 0.03225806451612903}, + {"key": "functional_suitability", "value": 0.0}, + ], + "tsqmi": [{"key": "tsqmi", "value": 0.023147764246074717}], } + assert calculated_result.get("repository") == calculate_expected.get("repository") assert calculated_result.get("version") == calculate_expected.get("version") measures_result = calculated_result.get("measures") @@ -245,6 +282,7 @@ def test_calculate_invalid_config_file(): shutil.copy("tests/unit/data/invalid_json.json", f"{config_dirpath}/msgram.json") args = { + "input_format": "github", "output_format": "csv", "config_path": Path(config_dirpath), "extracted_path": Path("."), @@ -278,6 +316,7 @@ def test_calculate_invalid_extracted_file(): ) args = { + "input_format": "github", "output_format": "csv", "config_path": Path(config_dirpath), "extracted_path": Path(extract_dirpath + f"/{extracted_file_name}"), diff --git a/tests/unit/test_jsonReader.py b/tests/unit/test_jsonReader.py index 8300a98f..b3fead2a 100644 --- a/tests/unit/test_jsonReader.py +++ b/tests/unit/test_jsonReader.py @@ -264,7 +264,9 @@ def test_read_multiple_files(): file_names = [ file_name - for _, file_name in jsonReader.read_multiple_files(Path(dirpath), "json") + for _, file_name in jsonReader.read_multiple_files( + Path(dirpath), "sonar", "json" + ) ] assert len(file_names) == 1 assert ( diff --git a/tests/unit/test_parser.py b/tests/unit/test_parser.py index 56320009..930e1768 100644 --- a/tests/unit/test_parser.py +++ b/tests/unit/test_parser.py @@ -76,6 +76,8 @@ def test_parser_calculate(): "/path/to/config", "-o", "csv", + "-in", + "github", ] ) assert args.func == command_calculate From 5f74a924eda3a0a1365db091c01fa69bc815f7c4 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 13:15:43 -0300 Subject: [PATCH 43/52] tests(bug/008): ajuste de teste do tsqmi --- tests/unit/test_tsqmi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_tsqmi.py b/tests/unit/test_tsqmi.py index 773c8b37..164121eb 100644 --- a/tests/unit/test_tsqmi.py +++ b/tests/unit/test_tsqmi.py @@ -14,4 +14,4 @@ def test_calculate_tsqmi(): infos, headers = calculate_tsqmi(config, characteristics) assert headers == ["Id", "Value", "Created at"] - assert infos == {"tsqmi": [{"key": "tsqmi", "value": 0.7643799276297641}]} + assert infos == {"tsqmi": [{"key": "tsqmi", "value": 0.7675182419725883}]} From a550495d7e29c94638669fd9d50d1ab261eb3903 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 13:34:23 -0300 Subject: [PATCH 44/52] =?UTF-8?q?fix(bug/008):=20Corre=C3=A7=C3=B5es=20do?= =?UTF-8?q?=20-h=20para=20informa=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/parsers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index f8c75c95..f19d09e7 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -177,7 +177,7 @@ def create_parser(): type=str, choices=AVAILABLE_IMPORTS, default="sonarqube", - help=("The type of the input (extracted) values is:".join(AVAILABLE_IMPORTS)), + help=("Format of .msgram files. Valid values are: " + ", ".join(AVAILABLE_IMPORTS)), ) parser_calculate.add_argument( @@ -186,7 +186,7 @@ def create_parser(): type=str, choices=AVAILABLE_GEN_FORMATS, default="csv", - help=("The format of the output (export) values are: ".join(SUPPORTED_FORMATS)), + help=("The format of the output (export) values are: " + ", ".join(SUPPORTED_FORMATS)), ) parser_calculate.set_defaults(func=command_calculate) # function command calculate @@ -241,7 +241,7 @@ def create_parser(): type=str, choices=AVAILABLE_GEN_FORMATS, default="json", - help=("The format of the output (export) values are: ".join(SUPPORTED_FORMATS)), + help=("The format of the output (export) values are: " + ", ".join(SUPPORTED_FORMATS)), ) parser_calculate.set_defaults(func=command_diff) # function command calculate From 2f78de9cd988daef08dffe7f59b9551afb04aef7 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 13:45:45 -0300 Subject: [PATCH 45/52] =?UTF-8?q?fix(bug/008):=20corre=C3=A7=C3=B5es=20de?= =?UTF-8?q?=20linter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/parsers.py | 14 +++++++++++--- tests/unit/test_aggregate.py | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cli/parsers.py b/src/cli/parsers.py index f19d09e7..fb042a33 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -177,7 +177,9 @@ def create_parser(): type=str, choices=AVAILABLE_IMPORTS, default="sonarqube", - help=("Format of .msgram files. Valid values are: " + ", ".join(AVAILABLE_IMPORTS)), + help=( + "Format of .msgram files. Valid values are: " + ", ".join(AVAILABLE_IMPORTS) + ), ) parser_calculate.add_argument( @@ -186,7 +188,10 @@ def create_parser(): type=str, choices=AVAILABLE_GEN_FORMATS, default="csv", - help=("The format of the output (export) values are: " + ", ".join(SUPPORTED_FORMATS)), + help=( + "The format of the output (export) values are: " + + ", ".join(SUPPORTED_FORMATS) + ), ) parser_calculate.set_defaults(func=command_calculate) # function command calculate @@ -241,7 +246,10 @@ def create_parser(): type=str, choices=AVAILABLE_GEN_FORMATS, default="json", - help=("The format of the output (export) values are: " + ", ".join(SUPPORTED_FORMATS)), + help=( + "The format of the output (export) values are: " + + ", ".join(SUPPORTED_FORMATS) + ), ) parser_calculate.set_defaults(func=command_diff) # function command calculate diff --git a/tests/unit/test_aggregate.py b/tests/unit/test_aggregate.py index 6ad598cc..d87adf20 100644 --- a/tests/unit/test_aggregate.py +++ b/tests/unit/test_aggregate.py @@ -2,7 +2,6 @@ import json import os import tempfile -from unittest.mock import patch from src.cli.aggregate_metrics import ( should_process_metrics, From 6c5d07172e45e5a7beb7c8f2f83a9b7c13513562 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 17:26:55 -0300 Subject: [PATCH 46/52] =?UTF-8?q?fix(bug/008):=20pequenas=20refatora=C3=A7?= =?UTF-8?q?=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_calculate.py | 5 ++--- src/cli/resources/measure.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index d72de5dd..60a5b4ac 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -25,10 +25,9 @@ def read_config_file(config_path): try: - config = FILE_CONFIG - return open_json_file(config_path / config) + return open_json_file(config_path / FILE_CONFIG) except exceptions.MeasureSoftGramCLIException as e: - print_error(f"[red]Error reading {config} config file in {config_path}: {e}\n") + print_error(f"[red]Error reading config file in {config_path}: {e}\n") print_rule() exit(1) diff --git a/src/cli/resources/measure.py b/src/cli/resources/measure.py index d6d85e59..3dd4aa60 100644 --- a/src/cli/resources/measure.py +++ b/src/cli/resources/measure.py @@ -22,7 +22,6 @@ def get_measure_value(measures, subchar): } ) - # print('calculated: ', measures_calculated) return measures_calculated From bf550650ea612296aa19718e78474cf89a1eabf6 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 17:32:11 -0300 Subject: [PATCH 47/52] =?UTF-8?q?fix/tests(bug/008):=20pequena=20corre?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20teste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_calculate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 60a5b4ac..8cba1f31 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -27,7 +27,9 @@ def read_config_file(config_path): try: return open_json_file(config_path / FILE_CONFIG) except exceptions.MeasureSoftGramCLIException as e: - print_error(f"[red]Error reading config file in {config_path}: {e}\n") + print_error( + f"[red]Error reading msgram.json config file in {config_path}: {e}\n" + ) print_rule() exit(1) From 7ef50b3fe366968a5788bf4a855985c9a15c34e1 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 18:41:47 -0300 Subject: [PATCH 48/52] fix: adjust lint --- src/cli/commands/cmd_extract.py | 2 +- src/cli/commands/cmd_norm_diff.py | 26 +++++++++++++++++++++----- src/cli/parsers.py | 6 ++++-- tests/unit/test_norm_diff.py | 4 ++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/cli/commands/cmd_extract.py b/src/cli/commands/cmd_extract.py index 0bffb71d..6a7d9eb5 100644 --- a/src/cli/commands/cmd_extract.py +++ b/src/cli/commands/cmd_extract.py @@ -102,7 +102,7 @@ def command_extract(args): if repository_path and output_origin == "github": filters = { "labels": label if label else "US,User Story,User Stories", - "workflows": workflows.split(',') if workflows else "build", + "workflows": workflows.split(",") if workflows else "build", "dates": filter_date if filter_date else None, } result = parser.parse( diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 1c1add69..7b2bba16 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -53,11 +53,23 @@ def command_norm_diff(args): planned_data = read_planned_file(rp_path, sort_key="key") calculated_data = read_calculated_file(rd_path) - planned_vector, calculated_vector = extract_values(planned_data, calculated_data, rp_path, rd_path) + planned_vector, calculated_vector = extract_values( + planned_data, calculated_data, rp_path, rd_path + ) norm_diff_value = norm_diff(planned_vector, calculated_vector) print_info("\n[#A9A9A9]Norm diff calculation performed successfully![/]\n") - print_info("[#A9A9A9]The norm_diff value indicates the difference between the observed quality (Rd) and the planned target (Rp). A norm_diff of 0 means that the observed quality perfectly aligns with the planned target. If norm_diff is not equal to 0, it shows a deviation from the target. In this case, you should determine whether the performance is above or below the planned quality. For a detailed analysis of these differences, use the msgram diff command.[/]\n") + + print_info( + "[#A9A9A9]The norm_diff value indicates the difference between the observed " + "quality (Rd) and the planned target (Rp). A norm_diff of 0 means that the " + "observed quality perfectly aligns with the planned target. If norm_diff is " + "not equal to 0, it shows a deviation from the target. In this case, you " + "should determine whether the performance is above or below the planned " + "quality. For a detailed analysis of these differences, use the msgram diff " + "command.[/]\n" + ) + print(f"Norm Diff: {norm_diff_value}") print_rule() @@ -88,16 +100,20 @@ def extract_values(planned_data, calculated_data, rp_path, rd_path): for value in planned_values: if value > 1 or value < 0: - print_error(f"[red]The values informed in the .json file {rp_path} must be between 0 and 1.\n") + print_error( + f"[red]The values informed in the .json file {rp_path} must be between 0 and 1.\n" + ) print_rule() exit(1) for value in calculated_values: if value > 1 or value < 0: - print_error(f"[red]The values informed in the .json file {rd_path} must be between 0 and 1.\n") + print_error( + f"[red]The values informed in the .json file {rd_path} must be between 0 and 1.\n" + ) print_rule() exit(1) - + return (np.array(planned_values), np.array(calculated_values)) except exceptions.MeasureSoftGramCLIException as e: print_error(f"[red]Error extracting values: {e}\n") diff --git a/src/cli/parsers.py b/src/cli/parsers.py index d21d8379..21832f31 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -190,14 +190,16 @@ def create_parser(): "-rp", "--rp_path", type=lambda p: Path(p).absolute(), - help="Path to the .json file with the planned/wished values ​​for the quality characteristics of a release. Quality requirements goals for a release.", + help="Path to the .json file with the planned/wished values ​​for the quality " + "characteristics of a release. Quality requirements goals for a release.", ) parser_norm_diff.add_argument( "-rd", "--rd_path", type=lambda p: Path(p).absolute(), - help="Path to the .json file with the model-calculated values ​​for a release's quality characteristics observed/developed.", + help="Path to the .json file with the model-calculated values ​​for a release's " + "quality characteristics observed/developed.", ) parser_norm_diff.set_defaults( diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index 98143716..29b5a69f 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -132,7 +132,7 @@ def test_missmatch_values(): assert excinfo.value.code == 1 assert "Error extracting values" in output -def test_planned_value_bigger_than_one(): +def test_planned_value_not_between_one_and_zero(): config_dirpath = tempfile.mkdtemp() captured_output = StringIO() @@ -157,7 +157,7 @@ def test_planned_value_bigger_than_one(): assert "The values informed in the .json" in output -def test_developed_value_bigger_than_one(): +def test_developed_value_not_between_one_and_zero(): config_dirpath = tempfile.mkdtemp() captured_output = StringIO() From b8f376a03945af6c4f71469321dcee400f8b9cb9 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 18:44:21 -0300 Subject: [PATCH 49/52] fix: adjust lint of tests --- tests/unit/test_norm_diff.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_norm_diff.py b/tests/unit/test_norm_diff.py index 29b5a69f..76d24ae2 100644 --- a/tests/unit/test_norm_diff.py +++ b/tests/unit/test_norm_diff.py @@ -29,7 +29,10 @@ def test_norm_diff(): output = captured_output.getvalue() assert "Norm diff calculation performed successfully!" in output - assert "The norm_diff value indicates the difference between the observed quality (Rd) and the planned target (Rp)." in output + assert ( + "The norm_diff value indicates the difference between the observed quality (Rd) and the planned target (Rp)." + in output + ) norm_diff_value = float(output.split("Norm Diff:")[1].split("\n")[0].strip()) assert norm_diff_value == 0.24323122001478284 @@ -132,13 +135,17 @@ def test_missmatch_values(): assert excinfo.value.code == 1 assert "Error extracting values" in output + def test_planned_value_not_between_one_and_zero(): config_dirpath = tempfile.mkdtemp() captured_output = StringIO() sys.stdout = captured_output - shutil.copy("tests/unit/data/planned-bigger-value.json", f"{config_dirpath}/planned-bigger-value.json") + shutil.copy( + "tests/unit/data/planned-bigger-value.json", + f"{config_dirpath}/planned-bigger-value.json", + ) shutil.copy("tests/unit/data/calculated.json", f"{config_dirpath}/calculated.json") with pytest.raises(SystemExit) as excinfo: @@ -164,7 +171,10 @@ def test_developed_value_not_between_one_and_zero(): sys.stdout = captured_output shutil.copy("tests/unit/data/planned.json", f"{config_dirpath}/planned.json") - shutil.copy("tests/unit/data/calculated-bigger-value.json", f"{config_dirpath}/calculated-bigger-value.json") + shutil.copy( + "tests/unit/data/calculated-bigger-value.json", + f"{config_dirpath}/calculated-bigger-value.json", + ) with pytest.raises(SystemExit) as excinfo: command_norm_diff( @@ -179,4 +189,4 @@ def test_developed_value_not_between_one_and_zero(): output = captured_output.getvalue() assert excinfo.value.code == 1 - assert "The values informed in the .json" in output \ No newline at end of file + assert "The values informed in the .json" in output From 47e382f1552a07ba928692b4d000b08c9a71c867 Mon Sep 17 00:00:00 2001 From: Thiago Gomes Date: Wed, 21 Aug 2024 19:44:39 -0300 Subject: [PATCH 50/52] test: adjust test of json files not found in extract command --- tests/system/test_extract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system/test_extract.py b/tests/system/test_extract.py index cd35fd43..c718c09e 100644 --- a/tests/system/test_extract.py +++ b/tests/system/test_extract.py @@ -15,7 +15,7 @@ def capture(command): def test_extract_metrics_folder_not_found_exception_handling(): config_dirpath = tempfile.mkdtemp() - _, err, returncode = capture( + msg, _, returncode = capture( [ "msgram", "extract", @@ -29,8 +29,8 @@ def test_extract_metrics_folder_not_found_exception_handling(): ) assert returncode == 1 - message = "src.cli.exceptions.exceptions.MeasureSoftGramCLIException: No files .json found inside folder." - assert message in err.decode("utf-8") + message = "No JSON files found in the specified data_path:" + assert message in msg.decode("utf-8") shutil.rmtree(config_dirpath) From b1c5cfbdf432f6e1cab260f759f082206398f631 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 21 Aug 2024 20:38:28 -0300 Subject: [PATCH 51/52] =?UTF-8?q?feat:=20atualizando=20vers=C3=B5es=20para?= =?UTF-8?q?=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf9bf4f6..adc41dab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "msgram" -version = "3.2.1" +version = "3.2.2" description = "The msgram CLI is a command-line interface to use MeasureSoftGram software" readme = "README.md" authors = [ @@ -32,7 +32,7 @@ dependencies = [ "python-dotenv", "rich", "validators~=0.33.0", - "msgram-core~=1.4.6", + "msgram-core~=1.4.9", "msgram-parser~=1.2.1", "anytree" ] diff --git a/requirements.txt b/requirements.txt index ee37da00..8c5e7e8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,6 @@ setuptools~=72.1.0 python-dotenv rich validators==0.33.0 -msgram-core~=1.4.6 +msgram-core~=1.4.9 msgram-parser~=1.2.1 anytree From b4d884e6fb40d6d421d0e729f7bdd6939105475b Mon Sep 17 00:00:00 2001 From: brenno-silva Date: Thu, 5 Sep 2024 21:05:37 -0300 Subject: [PATCH 52/52] =?UTF-8?q?fix:=20ajusta=20textos=20e=20valida=C3=A7?= =?UTF-8?q?=C3=B5es=20da=20diff=20e=20norm=5Fdiff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/cmd_calculate.py | 5 +++-- src/cli/commands/cmd_diff.py | 19 +++++++++++++------ src/cli/commands/cmd_norm_diff.py | 25 +++++++++---------------- src/cli/parsers.py | 6 ++++-- src/cli/utils.py | 19 +++++++++++++++++++ 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/cli/commands/cmd_calculate.py b/src/cli/commands/cmd_calculate.py index 8cba1f31..4e623c1a 100644 --- a/src/cli/commands/cmd_calculate.py +++ b/src/cli/commands/cmd_calculate.py @@ -96,8 +96,9 @@ def command_calculate(args): print_panel( title="Done", - menssage="> See our docs for more information: \n" - " https://github.com/fga-eps-mds/2022-2-MeasureSoftGram-CLI", + menssage="> See the publications for more information: \n" + "https://dl.acm.org/doi/10.1145/3239235.3267438 \n" + "https://dl.acm.org/doi/10.1145/3422392.3422450 \n", ) diff --git a/src/cli/commands/cmd_diff.py b/src/cli/commands/cmd_diff.py index 04b1d0c6..6a90fe88 100644 --- a/src/cli/commands/cmd_diff.py +++ b/src/cli/commands/cmd_diff.py @@ -15,6 +15,7 @@ print_info, print_panel, print_rule, + validate_json_values, ) from src.cli.exceptions import exceptions from src.config.settings import DEFAULT_CONFIG_PATH @@ -61,7 +62,7 @@ def read_calculated_file(extracted_calculation): exit(1) -def calculate_diff(planned, calculated): +def calculate_diff(planned, calculated, rp_path, rd_path): formated_result = [] try: @@ -73,7 +74,7 @@ def calculate_diff(planned, calculated): ) data_planned, data_calculated = extract_values( - planned, calculated_item["characteristics"] + planned, calculated_item["characteristics"], rp_path, rd_path ) diff_calculated = diff(data_planned, data_calculated) @@ -124,7 +125,9 @@ def command_diff(args): calculated = read_calculated_file(extracted_calculation) - diff_calculated, success = calculate_diff(planned, calculated) + diff_calculated, success = calculate_diff( + planned, calculated, config_path, extracted_calculation + ) if success: print_info("\n[#A9A9A9]Diff calculation performed[/] successfully!") @@ -136,8 +139,9 @@ def command_diff(args): print_panel( title="Done", - menssage="> See our docs for more information: \n" - " https://github.com/fga-eps-mds/2022-2-MeasureSoftGram-CLI", + menssage="> See the publications for more information: \n" + "https://dl.acm.org/doi/10.1145/3239235.3267438 \n" + "https://dl.acm.org/doi/10.1145/3422392.3422450 \n", ) @@ -208,7 +212,7 @@ def export_csv(data_calculated: list, file_path: Path = Path("DEFAULT_CONFIG_PAT print(f"Success: {file_path.name} exported as CSV") -def extract_values(planned, calculated): +def extract_values(planned, calculated, rp_path, rd_path): vector_calculated = [] vector_planned = [] @@ -221,4 +225,7 @@ def extract_values(planned, calculated): vector_calculated.append(calculated[x]["value"]) vector_planned.append(planned[x]["value"]) + validate_json_values(vector_planned, rp_path) + validate_json_values(vector_calculated, rd_path) + return vector_planned, vector_calculated diff --git a/src/cli/commands/cmd_norm_diff.py b/src/cli/commands/cmd_norm_diff.py index 7b2bba16..9fef428e 100644 --- a/src/cli/commands/cmd_norm_diff.py +++ b/src/cli/commands/cmd_norm_diff.py @@ -1,7 +1,12 @@ import logging from core.transformations import norm_diff from src.cli.jsonReader import open_json_file -from src.cli.utils import print_error, print_info, print_rule +from src.cli.utils import ( + print_error, + print_info, + print_rule, + validate_json_values, +) from src.cli.exceptions import exceptions import numpy as np @@ -51,6 +56,7 @@ def command_norm_diff(args): exit(1) planned_data = read_planned_file(rp_path, sort_key="key") + calculated_data = read_calculated_file(rd_path) planned_vector, calculated_vector = extract_values( @@ -98,21 +104,8 @@ def extract_values(planned_data, calculated_data, rp_path, rd_path): planned_values = [planned_dict[key] for key in planned_keys] calculated_values = [calculated_dict[key] for key in planned_keys] - for value in planned_values: - if value > 1 or value < 0: - print_error( - f"[red]The values informed in the .json file {rp_path} must be between 0 and 1.\n" - ) - print_rule() - exit(1) - - for value in calculated_values: - if value > 1 or value < 0: - print_error( - f"[red]The values informed in the .json file {rd_path} must be between 0 and 1.\n" - ) - print_rule() - exit(1) + validate_json_values(planned_values, rp_path) + validate_json_values(calculated_values, rd_path) return (np.array(planned_values), np.array(calculated_values)) except exceptions.MeasureSoftGramCLIException as e: diff --git a/src/cli/parsers.py b/src/cli/parsers.py index 26526d35..4395a82c 100644 --- a/src/cli/parsers.py +++ b/src/cli/parsers.py @@ -198,7 +198,8 @@ def create_parser(): # =====================================< COMMAND norm_diff >===================================== parser_norm_diff = subparsers.add_parser( "norm_diff", - help="Calculate the norm difference between the planned metrics and the developed.", + help="Calculates the Frobenius norm of the difference between tensors RP and RD, which means the quantitative " + "perception of the discrepancy between the planned and developed quality requirements in a release.", ) parser_norm_diff.add_argument( @@ -224,7 +225,8 @@ def create_parser(): # =====================================< COMMAND diff >===================================== parser_calculate = subparsers.add_parser( "diff", - help="Calculates differences between planned and developed values. Returns the result vector.", + help="Calculates and interprets the difference between the planned and developed quantitative perceptions " + "of each quality characteristic, represented by the RP and RD tensors.", ) parser_calculate.add_argument( diff --git a/src/cli/utils.py b/src/cli/utils.py index ca5f34a6..5dd9df29 100644 --- a/src/cli/utils.py +++ b/src/cli/utils.py @@ -9,6 +9,8 @@ from rich.table import Table from rich.text import Text +from src.cli.exceptions import exceptions + logger = logging.getLogger("msgram") console = Console(highlight=False, soft_wrap=False, width=140) @@ -173,3 +175,20 @@ def format_diff_color(value): return "red" else: return "white" + + +def validate_json_values(file, file_path): + for value in file: + try: + if value > 1 or value < 0: + raise exceptions.MeasureSoftGramCLIException( + f"[red]The values informed in the .json file {file_path} must be between 0 and 1.\n" + ) + except exceptions.MeasureSoftGramCLIException as e: + print_error(f"[red]Failed to decode the JSON file: {e}\n") + print_rule() + exit(1) + except TypeError as e: + print_error(f"[red]Failed to decode the JSON file: The values informed in the .json file {file_path} must be between 0 and 1.\n") + print_rule() + exit(1)