project_name string | class_name string | class_modifiers string | class_implements int64 | class_extends int64 | function_name string | function_body string | cyclomatic_complexity int64 | NLOC int64 | num_parameter int64 | num_token int64 | num_variable int64 | start_line int64 | end_line int64 | function_index int64 | function_params string | function_variable string | function_return_type string | function_body_line_type string | function_num_functions int64 | function_num_lines int64 | outgoing_function_count int64 | outgoing_function_names string | incoming_function_count int64 | incoming_function_names string | lexical_representation string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aiondemand_AIOD-rest-api | ServiceRouter | public | 0 | 1 | resource_class | def resource_class(self) -> type[Service]:return Service | 1 | 2 | 1 | 12 | 0 | 19 | 20 | 19 | self | [] | type[Service] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called ServiceRouter, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | TeamRouter | public | 0 | 1 | version | def version(self) -> int:return 1 | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | int | {"Return": 1} | 0 | 2 | 0 | [] | 20 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3719382_myint_rstcheck.src.rstcheck._cli_py.version_callback", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3913638_scijava_scyjava.src.scyjava._versions_py.get_version", "_.content.gdrive.MyDrive.Phd_Thesis.Datase... | The function (version) defined within the public class called TeamRouter, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 20.0 functions calling thi... |
aiondemand_AIOD-rest-api | TeamRouter | public | 0 | 1 | resource_name | def resource_name(self) -> str:return "team" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name) defined within the public class called TeamRouter, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | TeamRouter | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "teams" | 1 | 2 | 1 | 9 | 0 | 15 | 16 | 15 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called TeamRouter, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | TeamRouter | public | 0 | 1 | resource_class | def resource_class(self) -> type[Team]:return Team | 1 | 2 | 1 | 12 | 0 | 19 | 20 | 19 | self | [] | type[Team] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called TeamRouter, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | ElasticsearchSingleton | public | 0 | 0 | __init__ | def __init__(self):if not ElasticsearchSingleton.__monostate:ElasticsearchSingleton.__monostate = self.__dict__user = os.getenv("ES_USER", "")pw = os.getenv("ES_PASSWORD", "")self.client = Elasticsearch("http://elasticsearch:9200", basic_auth=(user, pw))else:self.__dict__ = ElasticsearchSingleton.__monostate | 2 | 8 | 1 | 63 | 0 | 14 | 21 | 14 | self | [] | None | {"Assign": 5, "If": 1} | 3 | 8 | 3 | ["os.getenv", "os.getenv", "Elasticsearch"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ElasticsearchSingleton.The function start at line 14 and ends at 21. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 function... |
aiondemand_AIOD-rest-api | ElasticsearchSingleton | public | 0 | 0 | patch | def patch(self, elasticsearch: Elasticsearch):self.__monostate["client"] = elasticsearch# type:ignore | 1 | 2 | 2 | 17 | 0 | 23 | 24 | 23 | self,elasticsearch | [] | None | {"Assign": 1} | 0 | 2 | 0 | [] | 3,224 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.tests.test_id_generators_py.KoremutakeGeneratorTest.test_it_doesnt_reuse_a_name_twice", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3536852_ubuntu_solutions_engineering_opensta... | The function (patch) defined within the public class called ElasticsearchSingleton.The function start at line 23 and ends at 24. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [23.0] and does not return any value. It has 3224.0 functions calling this function ... |
aiondemand_AIOD-rest-api | SearchRouterCaseStudies | public | 0 | 1 | es_index | def es_index(self) -> str:return "case_study" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterCaseStudies, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterCaseStudies | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "case_studies" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterCaseStudies, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterCaseStudies | public | 0 | 1 | resource_class | def resource_class(self):return CaseStudy | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterCaseStudies, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterCaseStudies | public | 0 | 1 | linked_fields | def linked_fields(self) -> set[str]:return {"alternate_name","application_area","industrial_sector","research_area","scientific_domain",} | 1 | 8 | 1 | 23 | 0 | 19 | 26 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 8 | 0 | [] | 0 | [] | The function (linked_fields) defined within the public class called SearchRouterCaseStudies, that inherit another class.The function start at line 19 and ends at 26. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterDatasets | public | 0 | 1 | es_index | def es_index(self) -> str:return "dataset" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterDatasets, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterDatasets | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "datasets" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterDatasets, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterDatasets | public | 0 | 1 | resource_class | def resource_class(self):return Dataset | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterDatasets, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterDatasets | public | 0 | 1 | extra_indexed_fields | def extra_indexed_fields(self) -> set[str]:return {"issn"} | 1 | 2 | 1 | 14 | 0 | 19 | 20 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (extra_indexed_fields) defined within the public class called SearchRouterDatasets, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterEducationalResources | public | 0 | 1 | es_index | def es_index(self) -> str:return "educational_resource" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterEducationalResources, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterEducationalResources | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "educational_resources" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterEducationalResources, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any val... |
aiondemand_AIOD-rest-api | SearchRouterEducationalResources | public | 0 | 1 | resource_class | def resource_class(self):return EducationalResource | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterEducationalResources, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value... |
aiondemand_AIOD-rest-api | SearchRouterEvents | public | 0 | 1 | es_index | def es_index(self) -> str:return "event" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterEvents, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterEvents | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "events" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterEvents, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterEvents | public | 0 | 1 | resource_class | def resource_class(self):return Event | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterEvents, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterExperiments | public | 0 | 1 | es_index | def es_index(self) -> str:return "experiment" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterExperiments, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterExperiments | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "experiments" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterExperiments, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterExperiments | public | 0 | 1 | resource_class | def resource_class(self):return Experiment | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterExperiments, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterMLModels | public | 0 | 1 | es_index | def es_index(self) -> str:return "ml_model" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterMLModels, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterMLModels | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "ml_models" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterMLModels, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterMLModels | public | 0 | 1 | resource_class | def resource_class(self):return MLModel | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterMLModels, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterNews | public | 0 | 1 | es_index | def es_index(self) -> str:return "news" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterNews, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterNews | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "news" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterNews, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterNews | public | 0 | 1 | resource_class | def resource_class(self):return News | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterNews, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterNews | public | 0 | 1 | extra_indexed_fields | def extra_indexed_fields(self) -> set[str]:return {"headline", "alternative_headline"} | 1 | 2 | 1 | 16 | 0 | 19 | 20 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (extra_indexed_fields) defined within the public class called SearchRouterNews, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterOrganisations | public | 0 | 1 | es_index | def es_index(self) -> str:return "organisation" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterOrganisations, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterOrganisations | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "organisations" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterOrganisations, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterOrganisations | public | 0 | 1 | resource_class | def resource_class(self):return Organisation | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterOrganisations, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterOrganisations | public | 0 | 1 | extra_indexed_fields | def extra_indexed_fields(self) -> set[str]:return {"legal_name"} | 1 | 2 | 1 | 14 | 0 | 19 | 20 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (extra_indexed_fields) defined within the public class called SearchRouterOrganisations, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterProjects | public | 0 | 1 | es_index | def es_index(self) -> str:return "project" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterProjects, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterProjects | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "projects" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterProjects, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterProjects | public | 0 | 1 | resource_class | def resource_class(self):return Project | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterProjects, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterPublications | public | 0 | 1 | es_index | def es_index(self) -> str:return "publication" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterPublications, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterPublications | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "publications" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterPublications, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterPublications | public | 0 | 1 | resource_class | def resource_class(self):return Publication | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterPublications, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterPublications | public | 0 | 1 | extra_indexed_fields | def extra_indexed_fields(self) -> set[str]:return {"issn", "isbn"} | 1 | 2 | 1 | 16 | 0 | 19 | 20 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (extra_indexed_fields) defined within the public class called SearchRouterPublications, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterServices | public | 0 | 1 | es_index | def es_index(self) -> str:return "service" | 1 | 2 | 1 | 9 | 0 | 7 | 8 | 7 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (es_index) defined within the public class called SearchRouterServices, that inherit another class.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterServices | public | 0 | 1 | resource_name_plural | def resource_name_plural(self) -> str:return "services" | 1 | 2 | 1 | 9 | 0 | 11 | 12 | 11 | self | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_name_plural) defined within the public class called SearchRouterServices, that inherit another class.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | SearchRouterServices | public | 0 | 1 | resource_class | def resource_class(self):return Service | 1 | 2 | 1 | 7 | 0 | 15 | 16 | 15 | self | [] | Returns | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (resource_class) defined within the public class called SearchRouterServices, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aiondemand_AIOD-rest-api | SearchRouterServices | public | 0 | 1 | extra_indexed_fields | def extra_indexed_fields(self) -> set[str]:return {"slogan"} | 1 | 2 | 1 | 14 | 0 | 19 | 20 | 19 | self | [] | set[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (extra_indexed_fields) defined within the public class called SearchRouterServices, that inherit another class.The function start at line 19 and ends at 20. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | generate_mapping | def generate_mapping(fields):mapping = copy.deepcopy(BASE_MAPPING)for field_name in fields:mapping["mappings"]["properties"][field_name] = {"type": "text","fields": {"keyword": {"type": "keyword"}},}return mapping | 2 | 8 | 1 | 49 | 1 | 18 | 25 | 18 | fields | ['mapping'] | Returns | {"Assign": 2, "For": 1, "Return": 1} | 1 | 8 | 1 | ["copy.deepcopy"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.setup.es_setup.generate_elasticsearch_indices_py.main"] | The function (generate_mapping) defined within the public class called public.The function start at line 18 and ends at 25. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function calle... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | main | def main():setup_logger()es_client = ElasticsearchSingleton().cliententities = {router.es_index: list(router.extra_indexed_fields) for router in router_list}logging.info("Generating indices...")for es_index, fields in entities.items():mapping = generate_mapping(fields)# ignore 400 cause by IndexAlreadyExistsException w... | 3 | 9 | 0 | 79 | 3 | 28 | 38 | 28 | ['mapping', 'es_client', 'entities'] | None | {"Assign": 3, "Expr": 4, "For": 1} | 8 | 11 | 8 | ["setup_logger", "ElasticsearchSingleton", "list", "logging.info", "entities.items", "generate_mapping", "es_client.indices.create", "logging.info"] | 332 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.main_py.init", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.test_tcurl_py.test_tcurl_health", "_.content.gdrive.MyDrive.Phd_Thesis... | The function (main) defined within the public class called public.The function start at line 28 and ends at 38. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 8.0 functions, It has 8.0 functions called inside whic... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | generate_file | def generate_file(file_path, template, file_data):with open(file_path, "w") as f:f.write(Template(FILE_IS_GENERATED_COMMENT).render(file_data))f.write(Template(template).render(file_data)) | 1 | 4 | 3 | 47 | 0 | 39 | 42 | 39 | file_path,template,file_data | [] | None | {"Expr": 2, "With": 1} | 7 | 4 | 7 | ["open", "f.write", "render", "Template", "f.write", "render", "Template"] | 6 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621044_bd2kgenomics_toil_scripts.src.toil_scripts.adam_gatk_pipeline.align_and_call_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3621044_bd2kgenomics_toil_scripts.src.toil_scripts.adam_pipeline.adam_prep... | The function (generate_file) defined within the public class called public.The function start at line 39 and ends at 42. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [39.0] and does not return any value. It declares 7.0 functions, It has 7.0 functions called... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | format_linked_field | def format_linked_field(linked_field):return (f"GROUP_CONCAT(DISTINCT {linked_field}.name "f"ORDER BY {linked_field}.name ASC SEPARATOR ',') {linked_field}") | 1 | 5 | 1 | 12 | 0 | 45 | 49 | 45 | linked_field | [] | Returns | {"Return": 1} | 0 | 5 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.setup.logstash_setup.generate_logstash_config_files_py.main"] | The function (format_linked_field) defined within the public class called public.The function start at line 45 and ends at 49. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It has 1.0 function calling this function which... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | format_linked_join | def format_linked_join(es_index, linked_field):return (f"LEFT JOIN aiod.{es_index}_{linked_field}_link ON "f"aiod.{es_index}.identifier=aiod.{es_index}_{linked_field}_link.from_identifier"f"\nLEFT JOIN aiod.{linked_field} ON "f"aiod.{es_index}_{linked_field}_link.linked_identifier=aiod.{linked_field}.identifier") | 1 | 7 | 2 | 18 | 0 | 52 | 58 | 52 | es_index,linked_field | [] | Returns | {"Return": 1} | 0 | 7 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.setup.logstash_setup.generate_logstash_config_files_py.main"] | The function (format_linked_join) defined within the public class called public.The function start at line 52 and ends at 58. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [52.0], and this function return a value. It has 1.0 function calling this function whi... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | main | def main():setup_logger()for path in (PATH_CONFIG, PATH_PIPELINE, PATH_SQL):path.mkdir(parents=True, exist_ok=True)entities = {router.es_index: (list(router.extra_indexed_fields), list(router.linked_fields))for router in router_list}render_parameters = {"file": os.path.basename(__file__),"path": os.path.dirname(__file_... | 8 | 54 | 0 | 393 | 10 | 61 | 116 | 61 | ['formated_linked_joins', 'render_parameters', 'sql_init_file', 'config_file', 'config_init_file', 'sql_sync_file', 'entities', 'config_sync_file', 'formated_linked_fields', 'sql_rm_file'] | None | {"Assign": 19, "Expr": 12, "For": 2, "If": 1} | 30 | 56 | 30 | ["setup_logger", "path.mkdir", "list", "list", "os.path.basename", "replace", "os.path.dirname", "entities.keys", "logging.info", "os.path.join", "os.path.join", "os.path.join", "generate_file", "generate_file", "generate_file", "logging.info", "logging.info", "entities.items", "join", "format_linked_field", "join", "f... | 332 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.main_py.init", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.test_tcurl_py.test_tcurl_health", "_.content.gdrive.MyDrive.Phd_Thesis... | The function (main) defined within the public class called public.The function start at line 61 and ends at 116. It contains 54 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declares 30.0 functions, It has 30.0 functions called inside ... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | parse_args | def parse_args():parser = ArgumentParser()parser.add_argument("--definitions-file",type=Path,default=Path("/data/taxonomies.json"),)return parser.parse_args() | 1 | 8 | 0 | 33 | 1 | 35 | 42 | 35 | ['parser'] | Returns | {"Assign": 1, "Expr": 1, "Return": 1} | 4 | 8 | 4 | ["ArgumentParser", "parser.add_argument", "Path", "parser.parse_args"] | 296 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.main_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3580082_pacificbiosciences_falcon.falcon_kit.mains.build_pdb_py.main", "_.content.gdrive.MyDrive.Phd_Thes... | The function (parse_args) defined within the public class called public.The function start at line 35 and ends at 42. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 4.0 functions, It has 4.0 functions called i... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | load_taxonomies_from_json.create_term | def create_term(element: dict) -> Taxonomy:term = element["label"]["value"]if len(term) > 256:raise ValueError(f"Term {term!r} exceeds maximum length of 256 characters.")definition = element["definition"]if len(definition) > 1800:definition_too_long = f"Definition for {term!r} exceeds maximum of 1800 characters."raise ... | 4 | 14 | 1 | 87 | 0 | 84 | 97 | 84 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (load_taxonomies_from_json.create_term) defined within the public class called public.The function start at line 84 and ends at 97. It contains 14 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | load_taxonomies_from_json | def load_taxonomies_from_json(file_path: Path):with file_path.open("r") as fh:file_content = json.load(fh)taxonomies = file_content["aiod_taxonomies"]for taxonomy in taxonomies:name = taxonomy["taxonomy_name"]if (type_ := type_by_name.get(name)) is None:logging.info(f"Skipping synchronization of {name!r}.")continue# no... | 4 | 13 | 1 | 92 | 7 | 72 | 100 | 72 | file_path | ['definition', 'definition_too_long', 'term', 'name', 'file_content', 'definitions', 'taxonomies'] | Returns | {"Assign": 7, "Expr": 3, "For": 1, "If": 3, "Return": 1, "With": 1} | 12 | 29 | 12 | ["file_path.open", "json.load", "type_by_name.get", "logging.info", "logging.info", "len", "ValueError", "len", "ValueError", "type_", "create_term", "create_term"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.taxonomies.synchronize_taxonomy_py.synchronize_taxonomy_from_file"] | The function (load_taxonomies_from_json) defined within the public class called public.The function start at line 72 and ends at 100. It contains 13 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 12.0 functions, It has 12.0... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | synchronize.synchronize_term | def synchronize_term(term: Taxonomy):synchronized_children = [synchronize_term(child) for child in term.children]if term_object := db_definitions.get(term.name.casefold()):logging.debug(f"Updating term {term.name!r}")term_object.name = term.name# The name might change in capitalizationterm_object.definition = term.defi... | 6 | 20 | 1 | 141 | 0 | 125 | 147 | 125 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (synchronize.synchronize_term) defined within the public class called public.The function start at line 125 and ends at 147. It contains 20 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value.. |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | synchronize | def synchronize(taxonomy_type: type[Taxonomy],# Really the subclass type, e.g. ResearchAreadefinitions: list[Taxonomy],# Samesession: Session,) -> None:"""Update the taxonomy table to reflect the provided definitions.- adds new definitions to the table- updates descriptions of definitions- mark definitions no longer in... | 6 | 19 | 3 | 109 | 4 | 103 | 152 | 103 | taxonomy_type,definitions,session | ['db_definitions', 'added_terms', 'synchronized_children', 'sync_term'] | None | {"Assign": 12, "Expr": 6, "For": 2, "If": 4, "Return": 3} | 17 | 50 | 17 | ["logging.info", "term.name.casefold", "all", "session.scalars", "select", "dict", "db_definitions.values", "synchronize_term", "db_definitions.get", "term.name.casefold", "logging.debug", "logging.debug", "db_definitions.get", "term.parent.name.casefold", "logging.warning", "synchronize_term", "session.merge"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3955845_rust_lang_homu.homu.server_py.synch_all", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.taxonomies.synchronize_taxonomy_py.synchronize_taxonomy_from_file", "_.content.gd... | The function (synchronize) defined within the public class called public.The function start at line 103 and ends at 152. It contains 19 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [103.0] and does not return any value. It declares 17.0 functions, It has 17.0 functions ca... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | synchronize_taxonomy_from_file | def synchronize_taxonomy_from_file(file: Path) -> None:taxonomies = load_taxonomies_from_json(file)with DbSession(autoflush=False) as session:for type_, definitions in taxonomies:synchronize(type_, definitions, session)logging.info("Committing changes to database.")session.commit() | 2 | 7 | 1 | 51 | 1 | 155 | 161 | 155 | file | ['taxonomies'] | None | {"Assign": 1, "Expr": 3, "For": 1, "With": 1} | 5 | 7 | 5 | ["load_taxonomies_from_json", "DbSession", "synchronize", "logging.info", "session.commit"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.main_py.create_app", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.taxonomies.synchronize_taxonomy_py.main"] | The function (synchronize_taxonomy_from_file) defined within the public class called public.The function start at line 155 and ends at 161. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | main | def main():logging.basicConfig(level=logging.INFO)logging.info("Starting synchronization script.")args = parse_args()synchronize_taxonomy_from_file(args.definitions_file) | 1 | 5 | 0 | 31 | 1 | 164 | 168 | 164 | ['args'] | None | {"Assign": 1, "Expr": 3} | 4 | 5 | 4 | ["logging.basicConfig", "logging.info", "parse_args", "synchronize_taxonomy_from_file"] | 332 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.main_py.init", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.test_tcurl_py.test_tcurl_health", "_.content.gdrive.MyDrive.Phd_Thesis... | The function (main) defined within the public class called public.The function start at line 164 and ends at 168. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside wh... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | pytest_generate_tests | def pytest_generate_tests(metafunc):# We want to automatically test endpoints on all supported versions,# and allow version-specific tests to be written using a# @pytest.mark.versions("vX") markerif "client" in metafunc.fixturenames:default_versions = (Version.LATEST, Version.V3)version_marker = next((m for m in metafu... | 7 | 12 | 1 | 112 | 5 | 8 | 24 | 8 | metafunc | ['version_marker', 'versions_to_include', 'selected_versions', 'versions', 'default_versions'] | None | {"Assign": 6, "Expr": 1, "If": 2} | 8 | 17 | 8 | ["next", "list", "metafunc.config.getoption", "Version", "intersection", "set", "set", "metafunc.parametrize"] | 0 | [] | The function (pytest_generate_tests) defined within the public class called public.The function start at line 8 and ends at 24. It contains 12 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 functi... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | pytest_addoption | def pytest_addoption(parser):parser.addoption("--versions",action="append",default=[],help="list of versions for which to run tests",) | 1 | 7 | 1 | 25 | 0 | 27 | 33 | 27 | parser | [] | None | {"Expr": 1} | 1 | 7 | 1 | ["parser.addoption"] | 0 | [] | The function (pytest_addoption) defined within the public class called public.The function start at line 27 and ends at 33. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function call... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_get_assets | def test_get_assets(client: TestClient,asset_type: str,request,):asset = request.getfixturevalue(asset_type)identifier = register_asset(asset)with logged_in_user():response = client.get(f"assets/{identifier}", headers={"Authorization": "fake-token"})# type: ignore[attr-defined]assert response.status_code == HTTPStatus.... | 1 | 12 | 3 | 78 | 4 | 19 | 31 | 19 | client,asset_type,request | ['response_json', 'asset', 'identifier', 'response'] | None | {"Assign": 4, "With": 1} | 7 | 13 | 7 | ["request.getfixturevalue", "register_asset", "logged_in_user", "client.get", "response.json", "response.json", "pytest.mark.parametrize"] | 0 | [] | The function (test_get_assets) defined within the public class called public.The function start at line 19 and ends at 31. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [19.0] and does not return any value. It declares 7.0 functions, and It has 7.0 function... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_ignore_deleted | def test_ignore_deleted(client: TestClient,organisation: Organisation,):organisation.name = "organisation"organisation.date_deleted = datetime.datetime.now()with DbSession() as session:session.add(organisation)session.commit()with logged_in_user():response = client.get(f"/assets/{organisation.identifier}", headers={"Au... | 1 | 12 | 2 | 82 | 1 | 34 | 47 | 34 | client,organisation | ['response'] | None | {"Assign": 3, "Expr": 2, "With": 2} | 7 | 14 | 7 | ["datetime.datetime.now", "DbSession", "session.add", "session.commit", "logged_in_user", "client.get", "response.json"] | 0 | [] | The function (test_ignore_deleted) defined within the public class called public.The function start at line 34 and ends at 47. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [34.0] and does not return any value. It declares 7.0 functions, and It has 7.0 func... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_happy_path | async def test_happy_path():with MockedKeycloak() as _:user = await get_user_or_raise(token="Bearer mocked")assert user.name == "user"assert set(user.roles) == {"offline_access", "uma_authorization", "default-roles-aiod"} | 1 | 5 | 0 | 41 | 1 | 17 | 21 | 17 | ['user'] | None | {"Assign": 1, "With": 1} | 3 | 5 | 3 | ["MockedKeycloak", "get_user_or_raise", "set"] | 0 | [] | The function (test_happy_path) defined within the public class called public.The function start at line 17 and ends at 21. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions ca... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_happy_path_privileged | async def test_happy_path_privileged():with MockedKeycloak(type_=TestUserType.privileged) as _:user = await get_user_or_raise(token="Bearer mocked")assert user.name == "user"assert set(user.roles) == {"offline_access","uma_authorization","default-roles-aiod",} | 1 | 9 | 0 | 47 | 1 | 25 | 33 | 25 | ['user'] | None | {"Assign": 1, "With": 1} | 3 | 9 | 3 | ["MockedKeycloak", "get_user_or_raise", "set"] | 0 | [] | The function (test_happy_path_privileged) defined within the public class called public.The function start at line 25 and ends at 33. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 f... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_get_user_or_none_leaks_no_information | def test_get_user_or_none_leaks_no_information(client):"""Make sure an error is thrown if you change the fields on KeycloakUser. There may be good reasonsto make a change, but please be very careful: we don't want to expose sensitive information toour application if it is not necessary. Moreover, the KeycloakUser class... | 1 | 5 | 1 | 61 | 1 | 36 | 46 | 36 | client | ['response'] | None | {"Assign": 1, "Expr": 1, "With": 1} | 6 | 11 | 6 | ["logged_in_user", "client.get", "response.json", "set", "keys", "response.json"] | 0 | [] | The function (test_get_user_or_none_leaks_no_information) defined within the public class called public.The function start at line 36 and ends at 46. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, a... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_inactive_user | async def test_inactive_user():with MockedKeycloak(type_=TestUserType.inactive) as _:with pytest.raises(HTTPException) as exception_info:await get_user_or_raise(token="Bearer mocked")assert exception_info.value.status_code == status.HTTP_401_UNAUTHORIZEDassert exception_info.value.detail == ("Invalid userinfo or inacti... | 1 | 9 | 0 | 54 | 0 | 50 | 59 | 50 | [] | None | {"Expr": 1, "With": 2} | 3 | 10 | 3 | ["MockedKeycloak", "pytest.raises", "get_user_or_raise"] | 0 | [] | The function (test_inactive_user) defined within the public class called public.The function start at line 50 and ends at 59. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_unauthenticated | async def test_unauthenticated():with pytest.raises(HTTPException) as exception_info:await get_user_or_raise(token=None)assert exception_info.value.status_code == status.HTTP_401_UNAUTHORIZEDassert (exception_info.value.detail== "No token found - This endpoint requires authorization. You need to be logged in.") | 1 | 8 | 0 | 41 | 0 | 63 | 70 | 63 | [] | None | {"Expr": 1, "With": 1} | 2 | 8 | 2 | ["pytest.raises", "get_user_or_raise"] | 0 | [] | The function (test_unauthenticated) defined within the public class called public.The function start at line 63 and ends at 70. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functio... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_keycloak_error | async def test_keycloak_error(mocked_token: Mock):"""On any problem, keycloak_openid.introspect raises an error.Refer to https://connect2id.com/products/server/docs/api/token-introspection for a list ofpossible errors. Only created a single testcase because we handle all errors the same way."""keycloak_openid.introspec... | 1 | 10 | 1 | 64 | 0 | 74 | 89 | 74 | mocked_token | [] | None | {"Assign": 1, "Expr": 2, "With": 1} | 4 | 16 | 4 | ["Mock", "KeycloakError", "pytest.raises", "get_user_or_raise"] | 0 | [] | The function (test_keycloak_error) defined within the public class called public.The function start at line 74 and ends at 89. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functio... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_create_bookmark | def test_create_bookmark(client: TestClient,person: Person) -> None:identifier = register_asset(person)with logged_in_user(ALICE):response = client.post(f"/bookmarks?resource_identifier={identifier}",headers={"Authorization": "fake token"},)assert response.status_code == HTTPStatus.OKbookmark = response.json()assert bo... | 1 | 14 | 2 | 92 | 4 | 16 | 31 | 16 | client,person | ['bookmark', 'now', 'identifier', 'response'] | None | {"Assign": 4, "With": 1} | 7 | 16 | 7 | ["register_asset", "logged_in_user", "client.post", "response.json", "datetime.utcnow", "total_seconds", "datetime.fromisoformat"] | 0 | [] | The function (test_create_bookmark) defined within the public class called public.The function start at line 16 and ends at 31. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [16.0] and does not return any value. It declares 7.0 functions, and It has 7.0 fun... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_create_bookmark_for_non_existing_resource | def test_create_bookmark_for_non_existing_resource(client: TestClient) -> None:# Create bookmark for non existing resource.with logged_in_user():response = client.post(f"/bookmarks?resource_identifier=wrong_indetifier",headers={"Authorization": "fake token"},)assert response.status_code == HTTPStatus.NOT_FOUNDassert re... | 1 | 8 | 1 | 52 | 1 | 34 | 44 | 34 | client | ['response'] | None | {"Assign": 1, "With": 1} | 3 | 11 | 3 | ["logged_in_user", "client.post", "response.json"] | 0 | [] | The function (test_create_bookmark_for_non_existing_resource) defined within the public class called public.The function start at line 34 and ends at 44. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 function... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_create_duplicate | def test_create_duplicate(client: TestClient,person: Person) -> None:with DbSession() as session:identifier = register_asset(person)user = register_user(ALICE, session)now = datetime.utcnow()bookmark = Bookmark(user_identifier=user.subject_identifier,resource_identifier=identifier,created_at=now)session.add(bookmark)se... | 1 | 24 | 2 | 127 | 5 | 47 | 74 | 47 | client,person | ['bookmark', 'now', 'response', 'user', 'identifier'] | None | {"Assign": 6, "Expr": 2, "With": 2} | 11 | 28 | 11 | ["DbSession", "register_asset", "register_user", "datetime.utcnow", "Bookmark", "session.add", "session.commit", "logged_in_user", "client.post", "response.json", "now.isoformat"] | 0 | [] | The function (test_create_duplicate) defined within the public class called public.The function start at line 47 and ends at 74. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [47.0] and does not return any value. It declares 11.0 functions, and It has 11.0 ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_get_bookmarks | def test_get_bookmarks(client: TestClient, person: Person, contact: Contact) -> None:with DbSession() as session:prsn_id = register_asset(person)contact_id = register_asset(contact)user = register_user(ALICE, session)session.commit()# Add a bookmarkwith logged_in_user(ALICE):response = client.post(f"/bookmarks?resource... | 1 | 24 | 3 | 146 | 5 | 77 | 106 | 77 | client,person,contact | ['bookmarks', 'contact_id', 'prsn_id', 'response', 'user'] | None | {"Assign": 7, "Expr": 1, "With": 2} | 11 | 30 | 11 | ["DbSession", "register_asset", "register_asset", "register_user", "session.commit", "logged_in_user", "client.post", "client.post", "client.get", "response.json", "len"] | 0 | [] | The function (test_get_bookmarks) defined within the public class called public.The function start at line 77 and ends at 106. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [77.0] and does not return any value. It declares 11.0 functions, and It has 11.0 fu... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_delete_bookmark | def test_delete_bookmark(client: TestClient,person: Person) -> None:with DbSession() as session:identifier = register_asset(person)register_user(ALICE, session)session.commit()with logged_in_user(ALICE):response = client.post(f"/bookmarks?resource_identifier={identifier}",headers={"Authorization": "fake token"},)assert... | 2 | 28 | 2 | 158 | 2 | 109 | 143 | 109 | client,person | ['identifier', 'response'] | None | {"Assign": 4, "Expr": 2, "With": 4} | 13 | 35 | 13 | ["DbSession", "register_asset", "register_user", "session.commit", "logged_in_user", "client.post", "logged_in_user", "client.delete", "response.json", "logged_in_user", "client.get", "all", "response.json"] | 0 | [] | The function (test_delete_bookmark) defined within the public class called public.The function start at line 109 and ends at 143. It contains 28 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [109.0] and does not return any value. It declares 13.0 functions, and It has 13.... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_get_bookmark_pagination | def test_get_bookmark_pagination(client: TestClient, publication_factory) -> None:PAGINATION_DEFAULT_LIMIT = 10publications = [publication_factory() for _ in range(PAGINATION_DEFAULT_LIMIT + 1)]with logged_in_user(ALICE):for pub in publications:register_asset(pub, owner=ALICE)response = client.post(f"/bookmarks?resourc... | 3 | 35 | 2 | 221 | 3 | 147 | 185 | 147 | client,publication_factory | ['PAGINATION_DEFAULT_LIMIT', 'publications', 'response'] | None | {"Assign": 7, "Expr": 1, "For": 1, "With": 1} | 18 | 39 | 18 | ["publication_factory", "range", "logged_in_user", "register_asset", "client.post", "client.get", "len", "response.json", "client.get", "len", "response.json", "client.get", "len", "response.json", "client.get", "len", "response.json", "pytest.mark.versions"] | 0 | [] | The function (test_get_bookmark_pagination) defined within the public class called public.The function start at line 147 and ends at 185. It contains 35 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [147.0] and does not return any value. It declares 18.0 functions, and It... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_merge_configuration_no_override_means_no_change | def test_merge_configuration_no_override_means_no_change():default = tomllib.loads(DEFAULT_CONFIG)merged = _merge_configurations(default, override={})assert default == merged | 1 | 4 | 0 | 27 | 2 | 19 | 22 | 19 | ['merged', 'default'] | None | {"Assign": 2} | 2 | 4 | 2 | ["tomllib.loads", "_merge_configurations"] | 0 | [] | The function (test_merge_configuration_no_override_means_no_change) defined within the public class called public.The function start at line 19 and ends at 22. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 fu... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_merge_configuration_nonnested | def test_merge_configuration_nonnested():default = tomllib.loads(DEFAULT_CONFIG)override_text = """[section1]integer = 0"""override = tomllib.loads(override_text)merged = _merge_configurations(default, override)assert merged["section1"]["integer"] == 0del merged["section1"]["integer"]del default["section1"]["integer"]a... | 1 | 12 | 0 | 61 | 4 | 25 | 38 | 25 | ['override_text', 'override', 'merged', 'default'] | None | {"Assign": 4} | 3 | 14 | 3 | ["tomllib.loads", "tomllib.loads", "_merge_configurations"] | 0 | [] | The function (test_merge_configuration_nonnested) defined within the public class called public.The function start at line 25 and ends at 38. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It ... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_merge_configuration_nested | def test_merge_configuration_nested():default = tomllib.loads(DEFAULT_CONFIG)override_text = """[section1.subsection]float = 1.0"""override = tomllib.loads(override_text)merged = _merge_configurations(default, override)assert merged["section1"]["subsection"]["float"] == 1.0del merged["section1"]["subsection"]["float"]d... | 1 | 12 | 0 | 72 | 4 | 41 | 54 | 41 | ['override_text', 'override', 'merged', 'default'] | None | {"Assign": 4} | 3 | 14 | 3 | ["tomllib.loads", "tomllib.loads", "_merge_configurations"] | 0 | [] | The function (test_merge_configuration_nested) defined within the public class called public.The function start at line 41 and ends at 54. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_merge_configuration_array | def test_merge_configuration_array():default = tomllib.loads(DEFAULT_CONFIG)override_text = """[section1.subsection]array = [0,3,7]"""override = tomllib.loads(override_text)merged = _merge_configurations(default, override)assert merged["section1"]["subsection"]["array"] == [0, 3, 7]del merged["section1"]["subsection"][... | 1 | 12 | 0 | 76 | 4 | 57 | 70 | 57 | ['override_text', 'override', 'merged', 'default'] | None | {"Assign": 4} | 3 | 14 | 3 | ["tomllib.loads", "tomllib.loads", "_merge_configurations"] | 0 | [] | The function (test_merge_configuration_array) defined within the public class called public.The function start at line 57 and ends at 70. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has ... | |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_reference_json_and_log_match | def test_reference_json_and_log_match(client, caplog):url_raises_because_dataset_does_not_exist = "/datasets/42"with caplog.at_level(logging.DEBUG):response = client.get(url_raises_because_dataset_does_not_exist).json()assert "reference" in response, responsereference_in_log = response["reference"] in caplog.textassert... | 1 | 7 | 2 | 52 | 3 | 4 | 11 | 4 | client,caplog | ['url_raises_because_dataset_does_not_exist', 'reference_in_log', 'response'] | None | {"Assign": 3, "With": 1} | 3 | 8 | 3 | ["caplog.at_level", "json", "client.get"] | 0 | [] | The function (test_reference_json_and_log_match) defined within the public class called public.The function start at line 4 and ends at 11. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [4.0] and does not return any value. It declares 3.0 functions, and It h... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_home_redirect_respects_proxy_header | def test_home_redirect_respects_proxy_header(prefix: str, client: TestClient):result = client.get("/", headers={"x-forwarded-prefix": prefix})assert f"{prefix}{client.version.prefix}/docs" in result.text# type: ignore[attr-defined] | 1 | 3 | 2 | 34 | 1 | 8 | 10 | 8 | prefix,client | ['result'] | None | {"Assign": 1} | 2 | 3 | 2 | ["client.get", "pytest.mark.parametrize"] | 0 | [] | The function (test_home_redirect_respects_proxy_header) defined within the public class called public.The function start at line 8 and ends at 10. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [8.0] and does not return any value. It declares 2.0 functions, an... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_oauth_redirect_respects_proxy_header | def test_oauth_redirect_respects_proxy_header(prefix: str, client: TestClient):result = client.get("/docs", headers={"x-forwarded-prefix": prefix})assert f"{prefix}{client.version.prefix}/docs/oauth2-redirect" in result.text# type: ignore[attr-defined] | 1 | 3 | 2 | 34 | 1 | 14 | 16 | 14 | prefix,client | ['result'] | None | {"Assign": 1} | 2 | 3 | 2 | ["client.get", "pytest.mark.parametrize"] | 0 | [] | The function (test_oauth_redirect_respects_proxy_header) defined within the public class called public.The function start at line 14 and ends at 16. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [14.0] and does not return any value. It declares 2.0 functions,... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_can_be_empty | def test_my_resources_can_be_empty(client: TestClient) -> None:with logged_in_user(ALICE):response = client.get("/user/resources", headers={"Authorization": "fake token"})assert response.status_code == HTTPStatus.OKmsg = "A user with no resources should get an empty list"assert all(items == [] for items in response.jso... | 2 | 7 | 1 | 77 | 2 | 17 | 23 | 17 | client | ['msg', 'response'] | None | {"Assign": 2, "With": 1} | 7 | 7 | 7 | ["logged_in_user", "client.get", "all", "values", "response.json", "len", "response.json"] | 0 | [] | The function (test_my_resources_can_be_empty) defined within the public class called public.The function start at line 17 and ends at 23. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_shows_draft_assets | def test_my_resources_shows_draft_assets(client: TestClient, publication: Publication) -> None:register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)with logged_in_user(ALICE):response = client.get("/user/resources", headers={"Authorization": "fake token"})assert response.status_code == HTTPStatus.OKassert ... | 1 | 8 | 2 | 98 | 2 | 26 | 33 | 26 | client,publication | ['msg', 'response'] | None | {"Assign": 2, "Expr": 1, "With": 1} | 6 | 8 | 6 | ["register_asset", "logged_in_user", "client.get", "len", "response.json", "response.json"] | 0 | [] | The function (test_my_resources_shows_draft_assets) defined within the public class called public.The function start at line 26 and ends at 33. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [26.0] and does not return any value. It declares 6.0 functions, and ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_shows_published_assets | def test_my_resources_shows_published_assets(client: TestClient, publication: Publication) -> None:register_asset(publication, owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(ALICE):response = client.get("/user/resources", headers={"Authorization": "fake token"})assert response.status_code == HTTPStatus.O... | 1 | 6 | 2 | 73 | 1 | 36 | 41 | 36 | client,publication | ['response'] | None | {"Assign": 1, "Expr": 1, "With": 1} | 5 | 6 | 5 | ["register_asset", "logged_in_user", "client.get", "len", "response.json"] | 0 | [] | The function (test_my_resources_shows_published_assets) defined within the public class called public.The function start at line 36 and ends at 41. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [36.0] and does not return any value. It declares 5.0 functions, ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_shows_mixed_assets | def test_my_resources_shows_mixed_assets(client: TestClient, publication: Publication, organisation: Organisation) -> None:register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)register_asset(organisation, owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(ALICE):response = client.get("/user/reso... | 3 | 15 | 3 | 171 | 5 | 44 | 62 | 44 | client,publication,organisation | ['publication_property', 'dataset_property', 'org', 'pub', 'response'] | None | {"Assign": 5, "Expr": 2, "With": 1} | 12 | 19 | 12 | ["register_asset", "register_asset", "logged_in_user", "client.get", "len", "response.json", "len", "response.json", "len", "response.json", "response.json", "response.json"] | 0 | [] | The function (test_my_resources_shows_mixed_assets) defined within the public class called public.The function start at line 44 and ends at 62. It contains 15 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [44.0] and does not return any value. It declares 12.0 functions, an... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_shows_only_own_resources | def test_my_resources_shows_only_own_resources(client: TestClient, publication_factory: Callable[[], Publication]) -> None:register_asset(publication_factory(), owner=ALICE, status=EntryStatus.DRAFT)register_asset(publication_factory(), owner=ALICE, status=EntryStatus.PUBLISHED)register_asset(publication_factory(), own... | 1 | 10 | 2 | 139 | 1 | 65 | 76 | 65 | client,publication_factory | ['response'] | None | {"Assign": 2, "Expr": 3, "With": 2} | 14 | 12 | 14 | ["register_asset", "publication_factory", "register_asset", "publication_factory", "register_asset", "publication_factory", "logged_in_user", "client.get", "len", "response.json", "logged_in_user", "client.get", "len", "response.json"] | 0 | [] | The function (test_my_resources_shows_only_own_resources) defined within the public class called public.The function start at line 65 and ends at 76. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [65.0] and does not return any value. It declares 14.0 functio... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_counts_only_if_admin | def test_my_resources_counts_only_if_admin(client: TestClient, publication_factory: Callable[[], Publication]) -> None:asset_one = publication_factory()identifier_one = register_asset(asset_one, owner=ALICE, status=EntryStatus.PUBLISHED)asset_two = publication_factory()identifier_two = register_asset(asset_two, owner=A... | 1 | 17 | 2 | 224 | 7 | 79 | 97 | 79 | client,publication_factory | ['asset_one', 'asset_two', 'identifier_three', 'identifier_two', 'response', 'identifier_one', 'asset_three'] | None | {"Assign": 7, "Expr": 5, "With": 2} | 20 | 19 | 20 | ["publication_factory", "register_asset", "publication_factory", "register_asset", "publication_factory", "register_asset", "DbSession", "register_user", "set_permission", "session.get", "set_permission", "session.get", "set_permission", "session.get", "session.commit", "logged_in_user", "client.get", "len", "response.... | 0 | [] | The function (test_my_resources_counts_only_if_admin) defined within the public class called public.The function start at line 79 and ends at 97. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [79.0] and does not return any value. It declares 20.0 functions, ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_must_be_authorized | def test_my_resources_must_be_authorized(client: TestClient) -> None:response = client.get("/user/resources")assert response.status_code == HTTPStatus.UNAUTHORIZED | 1 | 3 | 1 | 25 | 1 | 100 | 102 | 100 | client | ['response'] | None | {"Assign": 1} | 1 | 3 | 1 | ["client.get"] | 0 | [] | The function (test_my_resources_must_be_authorized) defined within the public class called public.The function start at line 100 and ends at 102. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_paginates | def test_my_resources_paginates(client: TestClient, publication_factory: Publication) -> None:register_asset(publication_factory(), owner=ALICE, status=EntryStatus.PUBLISHED)register_asset(publication_factory(), owner=ALICE, status=EntryStatus.PUBLISHED)register_asset(publication_factory(), owner=ALICE, status=EntrySta... | 2 | 17 | 2 | 229 | 3 | 105 | 125 | 105 | client,publication_factory | ['msg', 'first_asset', 'response'] | None | {"Assign": 5, "Expr": 3, "With": 1} | 18 | 21 | 18 | ["register_asset", "publication_factory", "register_asset", "publication_factory", "register_asset", "publication_factory", "logged_in_user", "client.get", "len", "response.json", "response.json", "client.get", "len", "response.json", "response.json", "client.get", "len", "response.json"] | 0 | [] | The function (test_my_resources_paginates) defined within the public class called public.The function start at line 105 and ends at 125. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [105.0] and does not return any value. It declares 18.0 functions, and It ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_no_limit_default_in_v2 | def test_my_resources_no_limit_default_in_v2(client: TestClient, publication_factory: Publication) -> None:for _ in range(11):# The default pagination limit is 10register_asset(publication_factory(), owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(ALICE):response = client.get("/user/resources", headers={"... | 2 | 7 | 2 | 81 | 1 | 129 | 136 | 129 | client,publication_factory | ['response'] | None | {"Assign": 1, "Expr": 1, "For": 1, "With": 1} | 8 | 8 | 8 | ["range", "register_asset", "publication_factory", "logged_in_user", "client.get", "len", "response.json", "pytest.mark.versions"] | 0 | [] | The function (test_my_resources_no_limit_default_in_v2) defined within the public class called public.The function start at line 129 and ends at 136. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [129.0] and does not return any value. It declares 8.0 function... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_my_resources_limit_default_in_latest | def test_my_resources_limit_default_in_latest(client: TestClient, publication_factory: Publication) -> None:for _ in range(11):# The default pagination limit is 10register_asset(publication_factory(), owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(ALICE):response = client.get("/user/resources", headers={... | 2 | 7 | 2 | 83 | 1 | 140 | 147 | 140 | client,publication_factory | ['response'] | None | {"Assign": 1, "Expr": 1, "For": 1, "With": 1} | 8 | 8 | 8 | ["range", "register_asset", "publication_factory", "logged_in_user", "client.get", "len", "response.json", "pytest.mark.versions"] | 0 | [] | The function (test_my_resources_limit_default_in_latest) defined within the public class called public.The function start at line 140 and ends at 147. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [140.0] and does not return any value. It declares 8.0 functio... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_user_must_be_logged_in_to_publish | def test_user_must_be_logged_in_to_publish(client, publication):response = client.post("/publications", content=publication.json(), headers=None)assert response.status_code == HTTPStatus.UNAUTHORIZEDwith logged_in_user(ALICE):response = client.post("/publications", content=publication.json(), headers={"Authorization": ... | 1 | 8 | 2 | 79 | 1 | 23 | 31 | 23 | client,publication | ['response'] | None | {"Assign": 2, "With": 1} | 6 | 9 | 6 | ["client.post", "publication.json", "logged_in_user", "client.post", "publication.json", "response.json"] | 0 | [] | The function (test_user_must_be_logged_in_to_publish) defined within the public class called public.The function start at line 23 and ends at 31. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [23.0] and does not return any value. It declares 6.0 functions, an... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_new_asset_is_draft | def test_new_asset_is_draft(client, publication, mocked_privileged_token: Mock):with logged_in_user(ALICE):response = client.post("/publications", content=publication.json(), headers={"Authorization": "Fake token"})assert response.status_code == HTTPStatus.OK, response.json()server_data = client.get(f"/publications/{re... | 1 | 11 | 3 | 89 | 2 | 34 | 45 | 34 | client,publication,mocked_privileged_token | ['server_data', 'response'] | None | {"Assign": 2, "With": 1} | 7 | 12 | 7 | ["logged_in_user", "client.post", "publication.json", "response.json", "json", "client.get", "response.json"] | 0 | [] | The function (test_new_asset_is_draft) defined within the public class called public.The function start at line 34 and ends at 45. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [34.0] and does not return any value. It declares 7.0 functions, and It has 7.0 ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_drafts_are_private | def test_drafts_are_private(client,publication,mocked_privileged_token: Mock,):with logged_in_user(ALICE):response = client.post("/publications", content=publication.json(), headers={"Authorization": "Fake token"})assert response.status_code == HTTPStatus.OK, response.json()response = client.get(f"/publications/{respon... | 1 | 12 | 3 | 71 | 1 | 48 | 60 | 48 | client,publication,mocked_privileged_token | ['response'] | None | {"Assign": 2, "Expr": 1, "With": 1} | 7 | 13 | 7 | ["logged_in_user", "client.post", "publication.json", "response.json", "client.get", "response.json", "pytest.skip"] | 0 | [] | The function (test_drafts_are_private) defined within the public class called public.The function start at line 48 and ends at 60. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [48.0] and does not return any value. It declares 7.0 functions, and It has 7.0 ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_user_can_submit_draft_for_review_v2 | def test_user_can_submit_draft_for_review_v2(comment, client, publication):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)content = f'{{"comment": "{comment}"}}' if comment else Nonewith logged_in_user(ALICE):submission = client.post(f"/publications/submit/{identifier}",headers={"Authori... | 3 | 18 | 3 | 163 | 4 | 71 | 90 | 71 | comment,client,publication | ['content', 'submission', 'queue', 'identifier'] | None | {"Assign": 5, "With": 2} | 13 | 20 | 13 | ["register_asset", "logged_in_user", "client.post", "submission.json", "submission.json", "logged_in_user", "client.get", "queue.json", "len", "queue.json", "queue.json", "pytest.mark.versions", "pytest.mark.parametrize"] | 0 | [] | The function (test_user_can_submit_draft_for_review_v2) defined within the public class called public.The function start at line 71 and ends at 90. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [71.0] and does not return any value. It declares 13.0 functions... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_user_can_submit_draft_for_review | def test_user_can_submit_draft_for_review(comment, client, publication):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)content: dict[str, str | list[str]] = {"asset_identifiers": [identifier]}if comment:content["comment"] = commentwith logged_in_user(ALICE):submission = client.post(f"/su... | 3 | 20 | 3 | 185 | 3 | 96 | 117 | 96 | comment,client,publication | ['submission', 'queue', 'identifier'] | None | {"AnnAssign": 1, "Assign": 5, "If": 1, "With": 2} | 12 | 22 | 12 | ["register_asset", "logged_in_user", "client.post", "submission.json", "submission.json", "logged_in_user", "client.get", "queue.json", "len", "queue.json", "queue.json", "pytest.mark.parametrize"] | 0 | [] | The function (test_user_can_submit_draft_for_review) defined within the public class called public.The function start at line 96 and ends at 117. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [96.0] and does not return any value. It declares 12.0 functions, ... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_user_needs_to_own_all_assets_for_submission | def test_user_needs_to_own_all_assets_for_submission(client, publication_factory):own = register_asset(publication_factory(), owner=ALICE, status=EntryStatus.DRAFT)bobs_publication = publication_factory()other = register_asset(bobs_publication, owner=BOB, status=EntryStatus.DRAFT)content: dict[str, str | list[str]] = {... | 1 | 26 | 2 | 202 | 5 | 120 | 148 | 120 | client,publication_factory | ['bobs_publication', 'own', 'other', 'submission', 'reason'] | None | {"AnnAssign": 1, "Assign": 7, "Expr": 3, "With": 3} | 13 | 29 | 13 | ["register_asset", "publication_factory", "publication_factory", "register_asset", "logged_in_user", "client.post", "submission.json", "DbSession", "session.add", "set_permission", "session.commit", "logged_in_user", "client.post"] | 0 | [] | The function (test_user_needs_to_own_all_assets_for_submission) defined within the public class called public.The function start at line 120 and ends at 148. It contains 26 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [120.0] and does not return any value. It declares 13.... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_user_can_not_submit_other_for_review | def test_user_can_not_submit_other_for_review(client, publication):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)with logged_in_user(BOB):submission = client.post(f"/submissions",headers={"Authorization": "Fake token"},json={"asset_identifiers": [identifier]},)assert submission.status_c... | 1 | 13 | 2 | 120 | 3 | 151 | 165 | 151 | client,publication | ['submission', 'queue', 'identifier'] | None | {"Assign": 3, "With": 2} | 9 | 15 | 9 | ["register_asset", "logged_in_user", "client.post", "submission.json", "logged_in_user", "client.get", "queue.json", "len", "queue.json"] | 0 | [] | The function (test_user_can_not_submit_other_for_review) defined within the public class called public.The function start at line 151 and ends at 165. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [151.0] and does not return any value. It declares 9.0 functi... |
aiondemand_AIOD-rest-api | public | public | 0 | 0 | test_a_draft_is_not_pending_for_review | def test_a_draft_is_not_pending_for_review(client, publication):register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)with logged_in_user(REVIEWER):queue = client.get("/submissions", headers={"Authorization": "Fake token"})assert queue.status_code == HTTPStatus.OK, queue.json()assert len(queue.json()) == 0,... | 1 | 6 | 2 | 70 | 1 | 168 | 174 | 168 | client,publication | ['queue'] | None | {"Assign": 1, "Expr": 1, "With": 1} | 6 | 7 | 6 | ["register_asset", "logged_in_user", "client.get", "queue.json", "len", "queue.json"] | 0 | [] | The function (test_a_draft_is_not_pending_for_review) defined within the public class called public.The function start at line 168 and ends at 174. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [168.0] and does not return any value. It declares 6.0 functions,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.