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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
maxmind_minfraud-api-python | public | public | 0 | 0 | prepare_report | def prepare_report(request: dict[str, Any],validate: bool,# noqa: FBT001) -> dict[str, Any]:"""Validate and prepare minFraud report."""cleaned_request = _copy_and_clean(request)if validate:try:validate_report(cleaned_request)except MultipleInvalid as ex:msg = f"Invalid report data: {ex}"raise InvalidRequestError(msg) f... | 3 | 12 | 2 | 58 | 2 | 269 | 281 | 269 | request,validate | ['cleaned_request', 'msg'] | dict[str, Any] | {"Assign": 2, "Expr": 2, "If": 1, "Return": 1, "Try": 1} | 3 | 13 | 3 | ["_copy_and_clean", "validate_report", "InvalidRequestError"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.webservice_py.AsyncClient.report", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.webservice_py.Client.report"] | The function (prepare_report) defined within the public class called public.The function start at line 269 and ends at 281. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [269.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions c... |
maxmind_minfraud-api-python | public | public | 0 | 0 | prepare_transaction | def prepare_transaction(request: dict[str, Any],validate: bool,# noqa: FBT001hash_email: bool,# noqa: FBT001) -> dict[str, Any]:"""Validate and prepare minFraud transaction."""cleaned_request = _copy_and_clean(request)if validate:try:validate_transaction(cleaned_request)except MultipleInvalid as ex:msg = f"Invalid tran... | 5 | 17 | 3 | 83 | 2 | 284 | 304 | 284 | request,validate,hash_email | ['cleaned_request', 'msg'] | dict[str, Any] | {"Assign": 2, "Expr": 4, "If": 3, "Return": 1, "Try": 1} | 6 | 21 | 6 | ["_copy_and_clean", "validate_transaction", "InvalidRequestError", "maybe_hash_email", "cleaned_request.get", "clean_credit_card"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.webservice_py.AsyncClient._response_for", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.webservice_py.Client._respons... | The function (prepare_transaction) defined within the public class called public.The function start at line 284 and ends at 304. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [284.0] and does not return any value. It declares 6.0 functions, It has 6.0 functi... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _copy_and_clean | def _copy_and_clean(data: Any) -> Any:# noqa: ANN401"""Create a copy of the data structure with Nones removed."""if isinstance(data, dict):return {k: _copy_and_clean(v) for (k, v) in data.items() if v is not None}if isinstance(data, (list, set, tuple)):return [_copy_and_clean(x) for x in data if x is not None]return da... | 7 | 6 | 1 | 76 | 0 | 307 | 313 | 307 | data | [] | Any | {"Expr": 1, "If": 2, "Return": 3} | 5 | 7 | 5 | ["isinstance", "_copy_and_clean", "data.items", "isinstance", "_copy_and_clean"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py._copy_and_clean", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py.prepare_report", "_.content.gdr... | The function (_copy_and_clean) defined within the public class called public.The function start at line 307 and ends at 313. It contains 6 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 5.0 functions, It has 5.0 functions calle... |
maxmind_minfraud-api-python | public | public | 0 | 0 | clean_credit_card | def clean_credit_card(credit_card: dict[str, Any]) -> None:"""Clean the credit_card input of a transaction request."""last4 = credit_card.pop("last_4_digits", None)if last4:warnings.warn("last_4_digits has been deprecated in favor of last_digits",DeprecationWarning,stacklevel=2,)credit_card["last_digits"] = last4 | 2 | 9 | 1 | 47 | 1 | 316 | 325 | 316 | credit_card | ['last4'] | None | {"Assign": 2, "Expr": 2, "If": 1} | 2 | 10 | 2 | ["credit_card.pop", "warnings.warn"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py.prepare_transaction", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.tests.test_request_py.TestRequest.test_clean_credit... | The function (clean_credit_card) defined within the public class called public.The function start at line 316 and ends at 325. It contains 9 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 2.0 functions, It has 2.0 functions cal... |
maxmind_minfraud-api-python | public | public | 0 | 0 | maybe_hash_email | def maybe_hash_email(transaction: dict[str, Any]) -> None:"""Hash email address in transaction, if present."""try:email = transaction["email"]address = email["address"]except KeyError:returnif address is None:returnaddress, domain = _clean_email(address)if address is None:returnif domain != "" and "domain" not in email... | 6 | 14 | 1 | 89 | 2 | 328 | 346 | 328 | transaction | ['email', 'address'] | None | {"Assign": 5, "Expr": 1, "If": 3, "Return": 3, "Try": 1} | 4 | 19 | 4 | ["_clean_email", "hexdigest", "hashlib.md5", "address.encode"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py.prepare_transaction", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.tests.test_request_py.TestRequest.test_maybe_hash_e... | The function (maybe_hash_email) defined within the public class called public.The function start at line 328 and ends at 346. It contains 14 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions cal... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _clean_domain | def _clean_domain(domain: str) -> str:domain = domain.strip().rstrip(".").encode("idna").decode("ASCII")domain = re.sub(r"(?:\.com){2,}$", ".com", domain)domain = re.sub(r"^\d+(?:gmail?\.com)$", "gmail.com", domain)idx = domain.rfind(".")if idx != -1:tld = domain[idx + 1 :]if typo_tld := _TYPO_TLDS.get(tld):domain = do... | 3 | 11 | 1 | 120 | 3 | 349 | 362 | 349 | domain | ['idx', 'tld', 'domain'] | str | {"Assign": 7, "If": 2, "Return": 1} | 10 | 14 | 10 | ["decode", "encode", "rstrip", "domain.strip", "re.sub", "re.sub", "domain.rfind", "_TYPO_TLDS.get", "_TYPO_DOMAINS.get", "_EQUIVALENT_DOMAINS.get"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py._clean_email"] | The function (_clean_domain) defined within the public class called public.The function start at line 349 and ends at 362. It contains 11 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 10.0 functions, It has 10.0 functions call... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _clean_email | def _clean_email(address: str) -> tuple[str | None, str | None]:address = address.lower().strip()at_idx = address.rfind("@")if at_idx == -1:return None, Nonedomain = _clean_domain(address[at_idx + 1 :])local_part = address[:at_idx]local_part = unicodedata.normalize("NFC", local_part)# Strip off aliased part of email ad... | 8 | 22 | 1 | 172 | 8 | 365 | 395 | 365 | address | ['address', 'at_idx', 'possible_domain', 'local_part', 'divider', 'domain_parts', 'domain', 'alias_idx'] | tuple[str | None, str | None] | {"Assign": 13, "If": 6, "Return": 2} | 10 | 31 | 10 | ["strip", "address.lower", "address.rfind", "_clean_domain", "unicodedata.normalize", "local_part.find", "local_part.replace", "domain.split", "len", "join"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py.maybe_hash_email", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.tests.test_request_py.TestRequest.test_clean_email"] | The function (_clean_email) defined within the public class called public.The function start at line 365 and ends at 395. It contains 22 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 10.0 functions, It has 10.0 functions calle... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _ip_address | def _ip_address(s: str | None) -> str:# ipaddress accepts numeric IPs, which we don't want.if isinstance(s, str) and not re.match(r"^\d+$", s):return str(ipaddress.ip_address(s))raise ValueError | 3 | 4 | 1 | 42 | 0 | 57 | 61 | 57 | s | [] | str | {"If": 1, "Return": 1} | 4 | 5 | 4 | ["isinstance", "re.match", "str", "ipaddress.ip_address"] | 0 | [] | The function (_ip_address) defined within the public class called public.The function start at line 57 and ends at 61. It contains 4 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 4.0 functions, and It has 4.0 functions called... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _email_or_md5 | def _email_or_md5(s: str) -> str:if re.match(r"^[0-9A-Fa-f]{32}$", s):return sreturn validate_email(s, check_deliverability=False).normalized | 2 | 4 | 1 | 33 | 0 | 64 | 67 | 64 | s | [] | str | {"If": 1, "Return": 2} | 2 | 4 | 2 | ["re.match", "validate_email"] | 0 | [] | The function (_email_or_md5) defined within the public class called public.The function start at line 64 and ends at 67. It contains 4 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 2.0 functions, and It has 2.0 functions call... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _hostname | def _hostname(hostname: str) -> str:if len(hostname) > 255:raise ValueErrorallowed = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)if all(allowed.match(x) for x in hostname.split(".")):return hostnameraise ValueError | 4 | 7 | 1 | 56 | 1 | 72 | 78 | 72 | hostname | ['allowed'] | str | {"Assign": 1, "If": 2, "Return": 1} | 5 | 7 | 5 | ["len", "re.compile", "all", "allowed.match", "hostname.split"] | 0 | [] | The function (_hostname) defined within the public class called public.The function start at line 72 and ends at 78. It contains 7 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functions called i... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _credit_card_token | def _credit_card_token(s: str) -> str:if re.match("^[\x21-\x7e]{1,255}$", s) and not re.match("^[0-9]{1,19}$", s):return sraise ValueError | 3 | 4 | 1 | 33 | 0 | 288 | 291 | 288 | s | [] | str | {"If": 1, "Return": 1} | 2 | 4 | 2 | ["re.match", "re.match"] | 0 | [] | The function (_credit_card_token) defined within the public class called public.The function start at line 288 and ends at 291. It contains 4 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 2.0 functions, and It has 2.0 functio... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _uri | def _uri(s: str) -> str:parsed = urllib.parse.urlparse(s)if parsed.scheme not in ["http", "https"] or not parsed.netloc:msg = "URL is invalid"raise UrlInvalid(msg)return s | 3 | 6 | 1 | 46 | 2 | 322 | 327 | 322 | s | ['parsed', 'msg'] | str | {"Assign": 2, "If": 1, "Return": 1} | 2 | 6 | 2 | ["urllib.parse.urlparse", "UrlInvalid"] | 0 | [] | The function (_uri) defined within the public class called public.The function start at line 322 and ends at 327. It contains 6 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 2.0 functions, and It has 2.0 functions called insi... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _maxmind_id | def _maxmind_id(s: str | None) -> str:if isinstance(s, str) and len(s) == 8:return sraise ValueError | 3 | 4 | 1 | 30 | 0 | 398 | 401 | 398 | s | [] | str | {"If": 1, "Return": 1} | 2 | 4 | 2 | ["isinstance", "len"] | 0 | [] | The function (_maxmind_id) defined within the public class called public.The function start at line 398 and ends at 401. It contains 4 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 2.0 functions, and It has 2.0 functions call... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _uuid | def _uuid(s: str) -> str:if isinstance(s, uuid.UUID):return str(s)if isinstance(s, str):return str(uuid.UUID(s))raise ValueError | 3 | 6 | 1 | 44 | 0 | 407 | 412 | 407 | s | [] | str | {"If": 2, "Return": 2} | 5 | 6 | 5 | ["isinstance", "str", "isinstance", "str", "uuid.UUID"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.validation_py._non_empty_uuid"] | The function (_uuid) defined within the public class called public.The function start at line 407 and ends at 412. It contains 6 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 5.0 functions, It has 5.0 functions called inside w... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _non_empty_uuid | def _non_empty_uuid(s: str) -> str:if _uuid(s) == NIL_UUID:raise ValueErrorreturn s | 2 | 4 | 1 | 21 | 0 | 418 | 421 | 418 | s | [] | str | {"If": 1, "Return": 1} | 1 | 4 | 1 | ["_uuid"] | 0 | [] | The function (_non_empty_uuid) defined within the public class called public.The function start at line 418 and ends at 421. It contains 4 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 declare 1.0 function, and It has 1.0 function cal... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _transaction_id | def _transaction_id(s: str | None) -> str:if isinstance(s, str) and len(s) > 0:return sraise ValueError | 3 | 4 | 1 | 30 | 0 | 424 | 427 | 424 | s | [] | str | {"If": 1, "Return": 1} | 2 | 4 | 2 | ["isinstance", "len"] | 0 | [] | The function (_transaction_id) defined within the public class called public.The function start at line 424 and ends at 427. It contains 4 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 2.0 functions, and It has 2.0 functions ... |
maxmind_minfraud-api-python | public | public | 0 | 0 | _validate_at_least_one_identifier_field | def _validate_at_least_one_identifier_field(report: dict) -> bool:optional_fields = ["ip_address", "maxmind_id", "minfraud_id", "transaction_id"]if not any(field in report for field in optional_fields):# We return MultipleInvalid instead of ValueError to be consistent with what# voluptuous returns.msg = ("The report mu... | 3 | 15 | 1 | 54 | 2 | 443 | 459 | 443 | report | ['optional_fields', 'msg'] | bool | {"Assign": 2, "If": 1, "Return": 1} | 3 | 17 | 3 | ["any", "MultipleInvalid", "RequiredFieldInvalid"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.validation_py.validate_report"] | The function (_validate_at_least_one_identifier_field) defined within the public class called public.The function start at line 443 and ends at 459. It contains 15 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 3.0 functions, I... |
maxmind_minfraud-api-python | public | public | 0 | 0 | validate_report | def validate_report(report: dict) -> bool:"""Validate minFraud Transaction Report fields."""_validate_report_schema(report)_validate_at_least_one_identifier_field(report)return True | 1 | 4 | 1 | 20 | 0 | 462 | 466 | 462 | report | [] | bool | {"Expr": 3, "Return": 1} | 2 | 5 | 2 | ["_validate_report_schema", "_validate_at_least_one_identifier_field"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.src.minfraud.request_py.prepare_report", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3700736_maxmind_minfraud_api_python.tests.test_validation_py.ValidationBase.check_invalid_re... | The function (validate_report) defined within the public class called public.The function start at line 462 and ends at 466. 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 functions, It has 2.0 functions calle... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | __init__ | def __init__(self,account_id: int,license_key: str,host: str = "minfraud.maxmind.com",locales: Sequence[str] = ("en",),timeout: float = 60,) -> None:"""Initialize the base client."""self._locales = localesself._account_id = str(account_id)self._license_key = license_keyself._timeout = timeoutbase_uri = f"{_SCHEME}://{h... | 1 | 17 | 5 | 92 | 0 | 58 | 75 | 58 | self,account_id,license_key,host,locales,timeout | [] | None | {"Assign": 9, "Expr": 1} | 1 | 18 | 1 | ["str"] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called BaseClient.The function start at line 58 and ends at 75. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [58.0] and does not return any value. It declare 1.0 function, It has 1.0 function called in... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _handle_success | def _handle_success(self,raw_body: str,uri: str,model_class: Callable,) -> Score | Factors | Insights:"""Handle successful response."""try:decoded_body = json.loads(raw_body)except ValueError as ex:msg = ("Received a 200 response but could not decode the "f"response as JSON: {raw_body}")raise MinFraudError(msg,200,uri,... | 2 | 19 | 4 | 65 | 0 | 77 | 96 | 77 | self,raw_body,uri,model_class | [] | Score | Factors | Insights | {"Assign": 2, "Expr": 1, "Return": 1, "Try": 1} | 3 | 20 | 3 | ["json.loads", "MinFraudError", "model_class"] | 0 | [] | The function (_handle_success) defined within the public class called BaseClient.The function start at line 77 and ends at 96. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [77.0] and does not return any value. It declares 3.0 functions, and It has 3.0 func... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _exception_for_error | def _exception_for_error(self,status: int,content_type: str | None,raw_body: str,uri: str,) -> (AuthenticationError| InsufficientFundsError| InvalidRequestError| HTTPError| PermissionRequiredError):"""Return the exception for the error responses."""if 400 <= status < 500:return self._exception_for_4xx_status(status, co... | 3 | 18 | 5 | 86 | 0 | 98 | 116 | 98 | self,status,content_type,raw_body,uri | [] | AuthenticationError | InsufficientFundsError | InvalidRequestError | HTTPError | PermissionRequiredError | {"Expr": 1, "If": 2, "Return": 3} | 3 | 19 | 3 | ["self._exception_for_4xx_status", "self._exception_for_5xx_status", "self._exception_for_unexpected_status"] | 0 | [] | The function (_exception_for_error) defined within the public class called BaseClient.The function start at line 98 and ends at 116. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [98.0] and does not return any value. It declares 3.0 functions, and It has 3.... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _exception_for_4xx_status | def _exception_for_4xx_status(self,status: int,content_type: str | None,raw_body: str,uri: str,) -> (AuthenticationError| InsufficientFundsError| InvalidRequestError| HTTPError| PermissionRequiredError):"""Return exception for error responses with 4xx status codes."""if not raw_body:return HTTPError(f"Received a {statu... | 7 | 51 | 5 | 157 | 0 | 118 | 170 | 118 | self,status,content_type,raw_body,uri | [] | AuthenticationError | InsufficientFundsError | InvalidRequestError | HTTPError | PermissionRequiredError | {"Assign": 1, "Expr": 1, "If": 3, "Return": 5, "Try": 1} | 9 | 53 | 9 | ["HTTPError", "content_type.find", "HTTPError", "json.loads", "HTTPError", "self._exception_for_web_service_error", "decoded_body.get", "decoded_body.get", "HTTPError"] | 0 | [] | The function (_exception_for_4xx_status) defined within the public class called BaseClient.The function start at line 118 and ends at 170. It contains 51 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [118.0] and does not return any value. It declares 9.0 functions, and It... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _exception_for_web_service_error | def _exception_for_web_service_error(message: str,code: str,status: int,uri: str,) -> (InvalidRequestError| AuthenticationError| PermissionRequiredError| InsufficientFundsError):"""Return exception for error responses with the JSON body."""if code in ("ACCOUNT_ID_REQUIRED","AUTHORIZATION_INVALID","LICENSE_KEY_REQUIRED"... | 4 | 23 | 4 | 81 | 0 | 173 | 197 | 173 | message,code,status,uri | [] | InvalidRequestError | AuthenticationError | PermissionRequiredError | InsufficientFundsError | {"Expr": 1, "If": 3, "Return": 4} | 4 | 25 | 4 | ["AuthenticationError", "InsufficientFundsError", "PermissionRequiredError", "InvalidRequestError"] | 0 | [] | The function (_exception_for_web_service_error) defined within the public class called BaseClient.The function start at line 173 and ends at 197. It contains 23 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [173.0] and does not return any value. It declares 4.0 functions, ... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _exception_for_5xx_status | def _exception_for_5xx_status(status: int,raw_body: str | None,uri: str,) -> HTTPError:"""Return exception for error response with 5xx status codes."""return HTTPError(f"Received a server error ({status}) for {uri}",status,uri,raw_body,) | 1 | 11 | 3 | 34 | 0 | 200 | 211 | 200 | status,raw_body,uri | [] | HTTPError | {"Expr": 1, "Return": 1} | 1 | 12 | 1 | ["HTTPError"] | 0 | [] | The function (_exception_for_5xx_status) defined within the public class called BaseClient.The function start at line 200 and ends at 211. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [200.0] and does not return any value. It declare 1.0 function, and It h... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | _exception_for_unexpected_status | def _exception_for_unexpected_status(status: int,raw_body: str | None,uri: str,) -> HTTPError:"""Return exception for responses with unexpected status codes."""return HTTPError(f"Received an unexpected HTTP status ({status}) for {uri}",status,uri,raw_body,) | 1 | 11 | 3 | 34 | 0 | 214 | 225 | 214 | status,raw_body,uri | [] | HTTPError | {"Expr": 1, "Return": 1} | 1 | 12 | 1 | ["HTTPError"] | 0 | [] | The function (_exception_for_unexpected_status) defined within the public class called BaseClient.The function start at line 214 and ends at 225. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [214.0] and does not return any value. It declare 1.0 function, an... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | __init__ | def __init__(# noqa: PLR0913self,account_id: int,license_key: str,host: str = "minfraud.maxmind.com",locales: Sequence[str] = ("en",),timeout: float = 60,proxy: str | None = None,) -> None:"""Construct AsyncClient.:param account_id: Your MaxMind account ID:type account_id: int:param license_key: Your MaxMind license ke... | 1 | 11 | 5 | 70 | 0 | 234 | 264 | 234 | self,account_id,license_key,host,locales,timeout | [] | None | {"Assign": 9, "Expr": 1} | 1 | 18 | 1 | ["str"] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called BaseClient.The function start at line 234 and ends at 264. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [234.0] and does not return any value. It declare 1.0 function, It has 1.0 function called... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | factors | async def factors(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Factors:"""Query Factors endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Factors web service as specifie... | 1 | 16 | 4 | 62 | 0 | 266 | 303 | 266 | self,transaction,validate,hash_email | [] | Factors | {"Expr": 1, "Return": 1} | 3 | 38 | 3 | ["cast", "self._response_for", "partial"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94705237_tenstorrent_tt_buda.pybuda.test.operators.grouped_reduce.test_grouped_reduce_py.test_grouped_reduce"] | The function (factors) defined within the public class called AsyncClient, that inherit another class.The function start at line 266 and ends at 303. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [266.0] and does not return any value. It declares 3.0 functio... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | insights | async def insights(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Insights:"""Query Insights endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Insights web service as spec... | 1 | 16 | 4 | 62 | 0 | 305 | 342 | 305 | self,transaction,validate,hash_email | [] | Insights | {"Expr": 1, "Return": 1} | 3 | 38 | 3 | ["cast", "self._response_for", "partial"] | 0 | [] | The function (insights) defined within the public class called AsyncClient, that inherit another class.The function start at line 305 and ends at 342. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [305.0] and does not return any value. It declares 3.0 functi... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | score | async def score(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Score:"""Query Score endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Score web service as specified in the... | 1 | 16 | 4 | 55 | 0 | 344 | 381 | 344 | self,transaction,validate,hash_email | [] | Score | {"Expr": 1, "Return": 1} | 2 | 38 | 2 | ["cast", "self._response_for"] | 9 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3969493_cheran_senthil_tle.tle.cogs.deactivated.cses_py.CSES.leaderboard", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3969493_cheran_senthil_tle.tle.cogs.deactivated.cses_py.CSES.leaderboard_individual", "_.conte... | The function (score) defined within the public class called AsyncClient, that inherit another class.The function start at line 344 and ends at 381. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [344.0] and does not return any value. It declares 2.0 functions... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | report | async def report(self,report: dict[str, str | None],validate: bool = True,# noqa: FBT001, FBT002) -> None:"""Send a transaction report to the Report Transaction endpoint.:param report: A dictionary containing the transaction report to be sentto the Report Transations web service as specified in the `REST API`documentat... | 2 | 13 | 3 | 89 | 0 | 383 | 413 | 383 | self,report,validate | [] | None | {"Assign": 5, "Expr": 1, "If": 1} | 4 | 31 | 4 | ["prepare_report", "self._do_request", "response.text", "self._exception_for_error"] | 10 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3958011_roddhjav_pass_import.pass_import.__main___py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3961676_fandoghpaas_fandogh_cli.fandogh_cli.info_collector_py.collect", "_.content.gdrive.MyDrive.Phd_Thesis.... | The function (report) defined within the public class called AsyncClient, that inherit another class.The function start at line 383 and ends at 413. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [383.0] and does not return any value. It declares 4.0 function... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | _response_for | async def _response_for(self,uri: str,model_class: Callable,request: dict[str, Any],validate: bool,# noqa: FBT001hash_email: bool,# noqa: FBT001) -> Score | Factors | Insights:"""Send request and create response object."""prepared_request = prepare_transaction(request, validate, hash_email)async with await self._do_req... | 2 | 16 | 6 | 109 | 0 | 415 | 432 | 415 | self,uri,model_class,request,validate,hash_email | [] | Score | Factors | Insights | {"Assign": 4, "Expr": 1, "If": 1, "Return": 1} | 5 | 18 | 5 | ["prepare_transaction", "self._do_request", "response.text", "self._exception_for_error", "self._handle_success"] | 0 | [] | The function (_response_for) defined within the public class called AsyncClient, that inherit another class.The function start at line 415 and ends at 432. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [415.0] and does not return any value. It declares 5.0 f... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | _do_request | async def _do_request(self,uri: str,data: dict[str, Any],) -> aiohttp.ClientResponse:session = await self._session()return await session.post(uri, json=data, proxy=self._proxy) | 1 | 7 | 3 | 49 | 0 | 434 | 440 | 434 | self,uri,data | [] | aiohttp.ClientResponse | {"Assign": 1, "Return": 1} | 2 | 7 | 2 | ["self._session", "session.post"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95079799_mozilla_mozci.mozci.util.taskcluster_py.find_task_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95079799_mozilla_mozci.mozci.util.taskcluster_py.get_artifact", "_.content.gdrive.MyDrive.Phd_Thesis.Data... | The function (_do_request) defined within the public class called AsyncClient, that inherit another class.The function start at line 434 and ends at 440. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [434.0] and does not return any value. It declares 2.0 func... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | _session | async def _session(self) -> aiohttp.ClientSession:if not hasattr(self, "_existing_session"):self._existing_session = aiohttp.ClientSession(auth=aiohttp.BasicAuth(self._account_id, self._license_key),headers={"Accept": "application/json", "User-Agent": _AIOHTTP_UA},timeout=aiohttp.ClientTimeout(total=self._timeout),)ret... | 2 | 8 | 1 | 71 | 0 | 442 | 450 | 442 | self | [] | aiohttp.ClientSession | {"Assign": 1, "If": 1, "Return": 1} | 4 | 9 | 4 | ["hasattr", "aiohttp.ClientSession", "aiohttp.BasicAuth", "aiohttp.ClientTimeout"] | 0 | [] | The function (_session) defined within the public class called AsyncClient, that inherit another class.The function start at line 442 and ends at 450. 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 4.0 functions, ... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | close | async def close(self) -> None:"""Close underlying session.This will close the session and any associated connections."""if hasattr(self, "_existing_session"):await self._existing_session.close() | 2 | 3 | 1 | 24 | 0 | 452 | 458 | 452 | self | [] | None | {"Expr": 2, "If": 1} | 2 | 7 | 2 | ["hasattr", "self._existing_session.close"] | 97 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18354993_vaticle_typedb_client_python.tests.behaviour.connection.transaction.transaction_steps_py.step_impl", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3470342_bitprophet_ssh.tests.test_client_py.SSHClientTest.t... | The function (close) defined within the public class called AsyncClient, that inherit another class.The function start at line 452 and ends at 458. It contains 3 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 2.0 functions, It ... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | __aenter__ | async def __aenter__(self) -> Self:return self | 1 | 2 | 1 | 9 | 0 | 460 | 461 | 460 | self | [] | Self | {"Return": 1} | 0 | 2 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94562214_home_assistant_core.homeassistant.components.aws_s3.__init___py.async_setup_entry"] | The function (__aenter__) defined within the public class called AsyncClient, that inherit another class.The function start at line 460 and ends at 461. 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 1.0 function calli... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | __aexit__ | async def __aexit__(self,exc_type: type[BaseException] | None,exc_value: BaseException | None,traceback: types.TracebackType | None,) -> None:await self.close() | 1 | 7 | 4 | 37 | 0 | 463 | 469 | 463 | self,exc_type,exc_value,traceback | [] | None | {"Expr": 1} | 1 | 7 | 1 | ["self.close"] | 0 | [] | The function (__aexit__) defined within the public class called AsyncClient, that inherit another class.The function start at line 463 and ends at 469. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [463.0] and does not return any value. It declare 1.0 functio... |
maxmind_minfraud-api-python | BaseClient | public | 0 | 0 | __init__ | def __init__(# noqa: PLR0913self,account_id: int,license_key: str,host: str = "minfraud.maxmind.com",locales: Sequence[str] = ("en",),timeout: float = 60,proxy: str | None = None,) -> None:"""Construct Client.:param account_id: Your MaxMind account ID:type account_id: int:param license_key: Your MaxMind license key:typ... | 2 | 18 | 5 | 130 | 0 | 478 | 522 | 478 | self,account_id,license_key,host,locales,timeout | [] | None | {"Assign": 9, "Expr": 1} | 1 | 18 | 1 | ["str"] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called BaseClient.The function start at line 478 and ends at 522. It contains 18 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [478.0] and does not return any value. It declare 1.0 function, It has 1.0 function called... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | factors | def factors(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Factors:"""Query Factors endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Factors web service as specified in t... | 1 | 16 | 4 | 61 | 0 | 524 | 561 | 524 | self,transaction,validate,hash_email | [] | Factors | {"Expr": 1, "Return": 1} | 3 | 38 | 3 | ["cast", "self._response_for", "partial"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94705237_tenstorrent_tt_buda.pybuda.test.operators.grouped_reduce.test_grouped_reduce_py.test_grouped_reduce"] | The function (factors) defined within the public class called AsyncClient, that inherit another class.The function start at line 524 and ends at 561. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [524.0] and does not return any value. It declares 3.0 functio... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | insights | def insights(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Insights:"""Query Insights endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Insights web service as specified ... | 1 | 16 | 4 | 61 | 0 | 563 | 600 | 563 | self,transaction,validate,hash_email | [] | Insights | {"Expr": 1, "Return": 1} | 3 | 38 | 3 | ["cast", "self._response_for", "partial"] | 0 | [] | The function (insights) defined within the public class called AsyncClient, that inherit another class.The function start at line 563 and ends at 600. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [563.0] and does not return any value. It declares 3.0 functi... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | score | def score(self,transaction: dict[str, Any],validate: bool = True,# noqa: FBT001, FBT002hash_email: bool = False,# noqa: FBT001, FBT002) -> Score:"""Query Score endpoint with transaction data.:param transaction: A dictionary containing the transaction to besent to the minFraud Score web service as specified in the `REST... | 1 | 16 | 4 | 54 | 0 | 602 | 639 | 602 | self,transaction,validate,hash_email | [] | Score | {"Expr": 1, "Return": 1} | 2 | 38 | 2 | ["cast", "self._response_for"] | 9 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3969493_cheran_senthil_tle.tle.cogs.deactivated.cses_py.CSES.leaderboard", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3969493_cheran_senthil_tle.tle.cogs.deactivated.cses_py.CSES.leaderboard_individual", "_.conte... | The function (score) defined within the public class called AsyncClient, that inherit another class.The function start at line 602 and ends at 639. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [602.0] and does not return any value. It declares 2.0 functions... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | report | def report(self,report: dict[str, str | None],validate: bool = True,# noqa: FBT001, FBT002) -> None:"""Send a transaction report to the Report Transaction endpoint.:param report: A dictionary containing the transaction report to be sentto the Report Transations web service as specified in the `REST API`documentation<ht... | 2 | 13 | 3 | 87 | 0 | 641 | 671 | 641 | self,report,validate | [] | None | {"Assign": 5, "Expr": 1, "If": 1} | 4 | 31 | 4 | ["prepare_report", "self._do_request", "response.text", "self._exception_for_error"] | 10 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3958011_roddhjav_pass_import.pass_import.__main___py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3961676_fandoghpaas_fandogh_cli.fandogh_cli.info_collector_py.collect", "_.content.gdrive.MyDrive.Phd_Thesis.... | The function (report) defined within the public class called AsyncClient, that inherit another class.The function start at line 641 and ends at 671. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [641.0] and does not return any value. It declares 4.0 function... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | _response_for | def _response_for(self,uri: str,model_class: Callable,request: dict[str, Any],validate: bool,# noqa: FBT001hash_email: bool,# noqa: FBT001) -> Score | Factors | Insights:"""Send request and create response object."""prepared_request = prepare_transaction(request, validate, hash_email)response = self._do_request(uri, pr... | 2 | 16 | 6 | 107 | 0 | 673 | 690 | 673 | self,uri,model_class,request,validate,hash_email | [] | Score | Factors | Insights | {"Assign": 4, "Expr": 1, "If": 1, "Return": 1} | 5 | 18 | 5 | ["prepare_transaction", "self._do_request", "response.text", "self._exception_for_error", "self._handle_success"] | 0 | [] | The function (_response_for) defined within the public class called AsyncClient, that inherit another class.The function start at line 673 and ends at 690. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [673.0] and does not return any value. It declares 5.0 f... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | _do_request | def _do_request(self, uri: str, data: dict[str, Any]) -> Response:return self._session.post(uri,json=data,timeout=self._timeout,proxies=self._proxies,) | 1 | 7 | 3 | 46 | 0 | 692 | 698 | 692 | self,uri,data | [] | aiohttp.ClientResponse | {"Assign": 1, "Return": 1} | 2 | 7 | 2 | ["self._session", "session.post"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95079799_mozilla_mozci.mozci.util.taskcluster_py.find_task_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95079799_mozilla_mozci.mozci.util.taskcluster_py.get_artifact", "_.content.gdrive.MyDrive.Phd_Thesis.Data... | The function (_do_request) defined within the public class called AsyncClient, that inherit another class.The function start at line 692 and ends at 698. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [692.0] and does not return any value. It declares 2.0 func... |
maxmind_minfraud-api-python | AsyncClient | public | 0 | 1 | close | def close(self) -> None:"""Close underlying session.This will close the session and any associated connections."""self._session.close() | 1 | 2 | 1 | 15 | 0 | 700 | 705 | 700 | self | [] | None | {"Expr": 2, "If": 1} | 2 | 7 | 2 | ["hasattr", "self._existing_session.close"] | 97 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.18354993_vaticle_typedb_client_python.tests.behaviour.connection.transaction.transaction_steps_py.step_impl", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3470342_bitprophet_ssh.tests.test_client_py.SSHClientTest.t... | The function (close) defined within the public class called AsyncClient, that inherit another class.The function start at line 700 and ends at 705. 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 declares 2.0 functions, It ... |
maxmind_minfraud-api-python | Client | public | 0 | 1 | __enter__ | def __enter__(self) -> Self:return self | 1 | 2 | 1 | 9 | 0 | 707 | 708 | 707 | self | [] | Self | {"Return": 1} | 0 | 2 | 0 | [] | 35 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.contexts_py.Functor.__enter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__enter__", "_.content.gdrive.M... | The function (__enter__) defined within the public class called Client, that inherit another class.The function start at line 707 and ends at 708. 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 35.0 functions calling t... |
maxmind_minfraud-api-python | Client | public | 0 | 1 | __exit__ | def __exit__(self,exc_type: type[BaseException] | None,exc_value: BaseException | None,traceback: types.TracebackType | None,) -> None:self.close() | 1 | 7 | 4 | 36 | 0 | 710 | 716 | 710 | self,exc_type,exc_value,traceback | [] | None | {"Expr": 1} | 1 | 7 | 1 | ["self.close"] | 32 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.wheeltools_py.InWheel.__exit__", "_.content.gd... | The function (__exit__) defined within the public class called Client, that inherit another class.The function start at line 710 and ends at 716. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [710.0] and does not return any value. It declare 1.0 function, It ... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | setUp | def setUp(self) -> None:self.maxDiff = 20_000 | 1 | 2 | 1 | 12 | 0 | 29 | 30 | 29 | self | [] | None | {"Assign": 1} | 0 | 2 | 0 | [] | 303 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.tests.test_backend_py.TestCouchDBBackend.setUp", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.tests.test_backend_py.TestMemoryBackend.setUp"... | The function (setUp) defined within the public class called TestModels, that inherit another class.The function start at line 29 and ends at 30. 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 303.0 functions calling th... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_billing_address | def test_billing_address(self) -> None:address = BillingAddress(**self.address_dict)# type: ignore[arg-type]self.check_address(address) | 1 | 3 | 1 | 22 | 0 | 32 | 34 | 32 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 3 | 2 | ["BillingAddress", "self.check_address"] | 0 | [] | The function (test_billing_address) defined within the public class called TestModels, that inherit another class.The function start at line 32 and ends at 34. 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 declares 2.0 fu... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_shipping_address | def test_shipping_address(self) -> None:address_dict = self.address_dictaddress_dict["is_high_risk"] = Falseaddress_dict["distance_to_billing_address"] = 200address = ShippingAddress(**address_dict)# type:ignore[arg-type]self.check_address(address)self.assertEqual(False, address.is_high_risk)self.assertEqual(200, addre... | 1 | 8 | 1 | 57 | 0 | 36 | 44 | 36 | self | [] | None | {"Assign": 4, "Expr": 3} | 4 | 9 | 4 | ["ShippingAddress", "self.check_address", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_shipping_address) defined within the public class called TestModels, that inherit another class.The function start at line 36 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 4.0 f... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | address_dict | def address_dict(self) -> dict[str, bool | float]:return {"is_in_ip_country": True,"latitude": 43.1,"longitude": 32.1,"distance_to_ip_location": 100,"is_postal_in_city": True,} | 1 | 8 | 1 | 41 | 0 | 47 | 54 | 47 | self | [] | dict[str, bool | float] | {"Return": 1} | 0 | 8 | 0 | [] | 0 | [] | The function (address_dict) defined within the public class called TestModels, that inherit another class.The function start at line 47 and ends at 54. 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.. |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | check_address | def check_address(self, address: BillingAddress | ShippingAddress) -> None:self.assertEqual(True, address.is_in_ip_country)self.assertEqual(True, address.is_postal_in_city)self.assertEqual(100, address.distance_to_ip_location)self.assertEqual(32.1, address.longitude)self.assertEqual(43.1, address.latitude) | 1 | 6 | 2 | 67 | 0 | 56 | 61 | 56 | self,address | [] | None | {"Expr": 5} | 5 | 6 | 5 | ["self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (check_address) defined within the public class called TestModels, that inherit another class.The function start at line 56 and ends at 61. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [56.0] and does not return any value. It declares 5.0 functi... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_credit_card | def test_credit_card(self) -> None:cc = CreditCard(issuer={"name": "Bank"},brand="Visa",country="US",is_issued_in_billing_address_country=True,is_business=True,is_prepaid=True,is_virtual=True,type="credit",)self.assertEqual("Bank", cc.issuer.name)self.assertEqual("Visa", cc.brand)self.assertEqual("US", cc.country)self.... | 1 | 19 | 1 | 130 | 0 | 63 | 82 | 63 | self | [] | None | {"Assign": 1, "Expr": 8} | 9 | 20 | 9 | ["CreditCard", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_credit_card) defined within the public class called TestModels, that inherit another class.The function start at line 63 and ends at 82. It contains 19 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 9.0 funct... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_device | def test_device(self) -> None:id = "b643d445-18b2-4b9d-bad4-c9c4366e402a"last_seen = "2016-06-08T14:16:38Z"local_time = "2016-06-10T14:19:10-08:00"device = Device(confidence=99,id=id,last_seen=last_seen,local_time=local_time,)self.assertEqual(99, device.confidence)self.assertEqual(id, device.id)self.assertEqual(last_se... | 1 | 14 | 1 | 77 | 0 | 84 | 98 | 84 | self | [] | None | {"Assign": 4, "Expr": 4} | 5 | 15 | 5 | ["Device", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_device) defined within the public class called TestModels, that inherit another class.The function start at line 84 and ends at 98. It contains 14 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 5.0 functions,... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_disposition | def test_disposition(self) -> None:disposition = Disposition(action="accept",reason="default",rule_label="custom rule label",)self.assertEqual("accept", disposition.action)self.assertEqual("default", disposition.reason)self.assertEqual("custom rule label", disposition.rule_label) | 1 | 9 | 1 | 54 | 0 | 100 | 109 | 100 | self | [] | None | {"Assign": 1, "Expr": 3} | 4 | 10 | 4 | ["Disposition", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_disposition) defined within the public class called TestModels, that inherit another class.The function start at line 100 and ends at 109. 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 4.0 func... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_email | def test_email(self) -> None:first_seen = "2016-01-01"email = Email(first_seen=first_seen,is_disposable=True,is_free=True,is_high_risk=False,)self.assertEqual(first_seen, email.first_seen)self.assertEqual(True, email.is_disposable)self.assertEqual(True, email.is_free)self.assertEqual(False, email.is_high_risk) | 1 | 12 | 1 | 71 | 0 | 111 | 123 | 111 | self | [] | None | {"Assign": 2, "Expr": 4} | 5 | 13 | 5 | ["Email", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_email) defined within the public class called TestModels, that inherit another class.The function start at line 111 and ends at 123. 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 5.0 functions... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_email_domain | def test_email_domain(self) -> None:first_seen = "2016-01-01"domain = EmailDomain(first_seen=first_seen,)self.assertEqual(first_seen, domain.first_seen) | 1 | 6 | 1 | 29 | 0 | 125 | 131 | 125 | self | [] | None | {"Assign": 2, "Expr": 1} | 2 | 7 | 2 | ["EmailDomain", "self.assertEqual"] | 0 | [] | The function (test_email_domain) defined within the public class called TestModels, that inherit another class.The function start at line 125 and ends at 131. It contains 6 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 fun... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_geoip2_location | def test_geoip2_location(self) -> None:time = "2015-04-19T12:59:23-01:00"location = GeoIP2Location(local_time=time, latitude=5)self.assertEqual(time, location.local_time)self.assertEqual(5, location.latitude) | 1 | 5 | 1 | 42 | 0 | 133 | 137 | 133 | self | [] | None | {"Assign": 2, "Expr": 2} | 3 | 5 | 3 | ["GeoIP2Location", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_geoip2_location) defined within the public class called TestModels, that inherit another class.The function start at line 133 and ends at 137. 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 ... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_ip_address | def test_ip_address(self) -> None:time = "2015-04-19T12:59:23-01:00"address = IPAddress(["en"],country={"is_in_european_union": True,},location={"local_time": time,},risk=99,risk_reasons=[{"code": "ANONYMOUS_IP","reason": "The IP address belongs to an anonymous network. ""See /ip_address/traits for more details.",},{"c... | 1 | 61 | 1 | 333 | 0 | 139 | 202 | 139 | self | [] | None | {"Assign": 2, "Expr": 17} | 18 | 64 | 18 | ["IPAddress", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.... | 0 | [] | The function (test_ip_address) defined within the public class called TestModels, that inherit another class.The function start at line 139 and ends at 202. It contains 61 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 18.0 fun... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_empty_address | def test_empty_address(self) -> None:address = IPAddress([])self.assertEqual([], address.risk_reasons) | 1 | 3 | 1 | 25 | 0 | 204 | 206 | 204 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 3 | 2 | ["IPAddress", "self.assertEqual"] | 0 | [] | The function (test_empty_address) defined within the public class called TestModels, that inherit another class.The function start at line 204 and ends at 206. 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 declares 2.0 fu... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_score_ip_address | def test_score_ip_address(self) -> None:address = ScoreIPAddress(risk=99)self.assertEqual(99, address.risk) | 1 | 3 | 1 | 25 | 0 | 208 | 210 | 208 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 3 | 2 | ["ScoreIPAddress", "self.assertEqual"] | 0 | [] | The function (test_score_ip_address) defined within the public class called TestModels, that inherit another class.The function start at line 208 and ends at 210. 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 declares 2.0... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_ip_address_locales | def test_ip_address_locales(self) -> None:loc = IPAddress(["fr"],country={"names": {"fr": "Country"}},city={"names": {"fr": "City"}},)self.assertEqual("City", loc.city.name)self.assertEqual("Country", loc.country.name) | 1 | 8 | 1 | 64 | 0 | 212 | 220 | 212 | self | [] | None | {"Assign": 1, "Expr": 2} | 3 | 9 | 3 | ["IPAddress", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_ip_address_locales) defined within the public class called TestModels, that inherit another class.The function start at line 212 and ends at 220. 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... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_issuer | def test_issuer(self) -> None:phone = "132-342-2131"issuer = Issuer(name="Bank",matches_provided_name=True,phone_number=phone,matches_provided_phone_number=True,)self.assertEqual("Bank", issuer.name)self.assertEqual(True, issuer.matches_provided_name)self.assertEqual(phone, issuer.phone_number)self.assertEqual(True, is... | 1 | 12 | 1 | 71 | 0 | 222 | 235 | 222 | self | [] | None | {"Assign": 2, "Expr": 4} | 5 | 14 | 5 | ["Issuer", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_issuer) defined within the public class called TestModels, that inherit another class.The function start at line 222 and ends at 235. 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 5.0 function... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_phone | def test_phone(self) -> None:phone = Phone(country="US",is_voip=True,matches_postal=True,network_operator="Verizon/1",number_type="fixed",)self.assertEqual("US", phone.country)self.assertEqual(True, phone.is_voip)self.assertEqual(True, phone.matches_postal)self.assertEqual("Verizon/1", phone.network_operator)self.asser... | 1 | 13 | 1 | 82 | 0 | 237 | 250 | 237 | self | [] | None | {"Assign": 1, "Expr": 5} | 6 | 14 | 6 | ["Phone", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_phone) defined within the public class called TestModels, that inherit another class.The function start at line 237 and ends at 250. It contains 13 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... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_warning | def test_warning(self) -> None:code = "INVALID_INPUT"msg = "Input invalid"warning = ServiceWarning(code=code, warning=msg, input_pointer="/first/second")self.assertEqual(code, warning.code)self.assertEqual(msg, warning.warning)self.assertEqual("/first/second", warning.input_pointer) | 1 | 7 | 1 | 59 | 0 | 252 | 260 | 252 | self | [] | None | {"Assign": 3, "Expr": 3} | 4 | 9 | 4 | ["ServiceWarning", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_warning) defined within the public class called TestModels, that inherit another class.The function start at line 252 and ends at 260. 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 declares 4.0 function... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_reason | def test_reason(self) -> None:code = "EMAIL_ADDRESS_NEW"msg = "Riskiness of newly-sighted email address"reason = Reason(code=code, reason=msg)self.assertEqual(code, reason.code)self.assertEqual(msg, reason.reason) | 1 | 6 | 1 | 45 | 0 | 262 | 269 | 262 | self | [] | None | {"Assign": 3, "Expr": 2} | 3 | 8 | 3 | ["Reason", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_reason) defined within the public class called TestModels, that inherit another class.The function start at line 262 and ends at 269. It contains 6 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... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_risk_score_reason | def test_risk_score_reason(self) -> None:multiplier = 0.34code = "EMAIL_ADDRESS_NEW"msg = "Riskiness of newly-sighted email address"reason = RiskScoreReason(multiplier=0.34,reasons=[{"code": code, "reason": msg}],)self.assertEqual(multiplier, reason.multiplier)self.assertEqual(code, reason.reasons[0].code)self.assertEq... | 1 | 11 | 1 | 83 | 0 | 271 | 283 | 271 | self | [] | None | {"Assign": 4, "Expr": 3} | 4 | 13 | 4 | ["RiskScoreReason", "self.assertEqual", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (test_risk_score_reason) defined within the public class called TestModels, that inherit another class.The function start at line 271 and ends at 283. It contains 11 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... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_score | def test_score(self) -> None:id = "b643d445-18b2-4b9d-bad4-c9c4366e402a"response = {"id": id,"funds_remaining": 10.01,"queries_remaining": 123,"risk_score": 0.01,"ip_address": {"risk": 99},"warnings": [{"code": "INVALID_INPUT"}],}score = Score(**response)# type: ignore[arg-type]self.assertEqual(id, score.id)self.assert... | 1 | 18 | 1 | 142 | 0 | 285 | 304 | 285 | self | [] | None | {"Assign": 3, "Expr": 7} | 9 | 20 | 9 | ["Score", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "score.to_dict"] | 0 | [] | The function (test_score) defined within the public class called TestModels, that inherit another class.The function start at line 285 and ends at 304. It contains 18 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 9.0 functions... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_insights | def test_insights(self) -> None:response = self.factors_response()del response["risk_score_reasons"]del response["subscores"]insights = Insights(None, **response)# type: ignore[arg-type]self.check_insights_data(insights, response["id"])self.assertEqual(response, insights.to_dict()) | 1 | 7 | 1 | 56 | 0 | 306 | 312 | 306 | self | [] | None | {"Assign": 2, "Expr": 2} | 5 | 7 | 5 | ["self.factors_response", "Insights", "self.check_insights_data", "self.assertEqual", "insights.to_dict"] | 0 | [] | The function (test_insights) defined within the public class called TestModels, that inherit another class.The function start at line 306 and ends at 312. 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 declares 5.0 functio... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | test_factors | def test_factors(self) -> None:response = self.factors_response()factors = Factors(None, **response)# type: ignore[arg-type]self.check_insights_data(factors, response["id"])self.check_risk_score_reasons_data(factors.risk_score_reasons)self.assertEqual(0.01, factors.subscores.avs_result)self.assertEqual(0.02, factors.su... | 1 | 32 | 1 | 336 | 0 | 314 | 346 | 314 | self | [] | None | {"Assign": 2, "Expr": 23} | 26 | 33 | 26 | ["self.factors_response", "Factors", "self.check_insights_data", "self.check_risk_score_reasons_data", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual... | 0 | [] | The function (test_factors) defined within the public class called TestModels, that inherit another class.The function start at line 314 and ends at 346. It contains 32 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 26.0 functi... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | factors_response | def factors_response(self) -> dict[str, Any]:return {"id": "b643d445-18b2-4b9d-bad4-c9c4366e402a","disposition": {"action": "reject"},"ip_address": {"country": {"iso_code": "US"}},"credit_card": {"is_business": True,"is_prepaid": True,"brand": "Visa","type": "debit",},"device": {"id": "b643d445-18b2-4b9d-bad4-c9c4366e4... | 1 | 55 | 1 | 295 | 0 | 348 | 402 | 348 | self | [] | dict[str, Any] | {"Return": 1} | 0 | 55 | 0 | [] | 0 | [] | The function (factors_response) defined within the public class called TestModels, that inherit another class.The function start at line 348 and ends at 402. It contains 55 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | check_insights_data | def check_insights_data(self, insights: Insights | Factors, uuid: str) -> None:self.assertEqual("US", insights.ip_address.country.iso_code)self.assertEqual(False, insights.ip_address.country.is_in_european_union)self.assertEqual(True, insights.credit_card.is_business)self.assertEqual(True, insights.credit_card.is_prepa... | 1 | 21 | 3 | 262 | 0 | 404 | 424 | 404 | self,insights,uuid | [] | None | {"Expr": 20} | 20 | 21 | 20 | ["self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual", "self.assertEqual",... | 0 | [] | The function (check_insights_data) defined within the public class called TestModels, that inherit another class.The function start at line 404 and ends at 424. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [404.0] and does not return any value. It declares ... |
maxmind_minfraud-api-python | TestModels | public | 0 | 1 | check_risk_score_reasons_data | def check_risk_score_reasons_data(self, reasons: list[RiskScoreReason]) -> None:self.assertEqual(1, len(reasons))self.assertEqual(45, reasons[0].multiplier)self.assertEqual(1, len(reasons[0].reasons))self.assertEqual("ANONYMOUS_IP", reasons[0].reasons[0].code)self.assertEqual("Risk due to IP being an Anonymous IP",reas... | 1 | 9 | 2 | 91 | 0 | 426 | 434 | 426 | self,reasons | [] | None | {"Expr": 5} | 7 | 9 | 7 | ["self.assertEqual", "len", "self.assertEqual", "self.assertEqual", "len", "self.assertEqual", "self.assertEqual"] | 0 | [] | The function (check_risk_score_reasons_data) defined within the public class called TestModels, that inherit another class.The function start at line 426 and ends at 434. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [426.0] and does not return any value. It ... |
maxmind_minfraud-api-python | TestRequest | public | 0 | 1 | test_maybe_hash_email | def test_maybe_hash_email(self) -> None:tests = [{"name": "no email","input": {"device": {"ip_address": "1.1.1.1"}},"expected": {"device": {"ip_address": "1.1.1.1"}},},{"name": "None email","input": {"email": {"address": None}},"expected": {"email": {"address": None}},},{"name": "empty email","input": {"email": {"addre... | 2 | 159 | 1 | 659 | 0 | 12 | 173 | 12 | self | [] | None | {"Assign": 2, "Expr": 2, "For": 1, "With": 1} | 4 | 162 | 4 | ["self.subTest", "maybe_hash_email", "cast", "self.assertEqual"] | 0 | [] | The function (test_maybe_hash_email) defined within the public class called TestRequest, that inherit another class.The function start at line 12 and ends at 173. It contains 159 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 4... |
maxmind_minfraud-api-python | TestRequest | public | 0 | 1 | test_clean_credit_card | def test_clean_credit_card(self) -> None:tests = [{"name": "deprecated last_4_digits is cleaned to last_digits","input": {"issuer_id_number": "123456","last_4_digits": "1234",},"expected": {"issuer_id_number": "123456","last_digits": "1234",},},{"name": "6 digit iin, 4 digit last_digits","input": {"issuer_id_number": "... | 2 | 41 | 1 | 152 | 0 | 175 | 218 | 175 | self | [] | None | {"Assign": 2, "Expr": 2, "For": 1, "With": 1} | 4 | 44 | 4 | ["self.subTest", "clean_credit_card", "cast", "self.assertEqual"] | 0 | [] | The function (test_clean_credit_card) defined within the public class called TestRequest, that inherit another class.The function start at line 175 and ends at 218. It contains 41 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 ... |
maxmind_minfraud-api-python | TestRequest | public | 0 | 1 | test_clean_email | def test_clean_email(self) -> None:tests: list[dict[str, str | None]] = [{"input": "", "output": None},{"input": "fasfs", "output": None},{"input": "test@gmail", "output": "test@gmail"},{"input": "e4d909c290d0fb1ca068ffaddf22cbd0", "output": None},{"input": "Test@maxmind", "output": "test@maxmind"},{"input": "Test@maxm... | 2 | 43 | 1 | 367 | 0 | 220 | 263 | 220 | self | [] | None | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "For": 1} | 3 | 44 | 3 | ["_clean_email", "cast", "self.assertEqual"] | 0 | [] | The function (test_clean_email) defined within the public class called TestRequest, that inherit another class.The function start at line 220 and ends at 263. It contains 43 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 fu... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | setup_transaction | def setup_transaction(self, transaction: dict[str, Any]) -> None:if "device" not in transaction:transaction["device"] = {}if "ip_address" not in transaction["device"]:transaction["device"]["ip_address"] = "1.1.1.1" | 3 | 5 | 2 | 47 | 0 | 13 | 18 | 13 | self,transaction | [] | None | {"Assign": 2, "If": 2} | 0 | 6 | 0 | [] | 0 | [] | The function (setup_transaction) defined within the public class called ValidationBase, that inherit another class.The function start at line 13 and ends at 18. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [13.0] and does not return any value.. |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_invalid_transaction | def check_invalid_transaction(self, transaction: dict[str, Any]) -> None:self.setup_transaction(transaction)with self.assertRaises(MultipleInvalid, msg=f"{transaction} is invalid"):validate_transaction(transaction) | 1 | 4 | 2 | 39 | 0 | 20 | 23 | 20 | self,transaction | [] | None | {"Expr": 2, "With": 1} | 3 | 4 | 3 | ["self.setup_transaction", "self.assertRaises", "validate_transaction"] | 0 | [] | The function (check_invalid_transaction) defined within the public class called ValidationBase, that inherit another class.The function start at line 20 and ends at 23. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [20.0] and does not return any value. It dec... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_transaction | def check_transaction(self, transaction: dict[str, Any]) -> None:self.setup_transaction(transaction)try:validate_transaction(transaction)except MultipleInvalid as e:self.fail(f"MultipleInvalid {e.msg} thrown for {transaction}") | 2 | 6 | 2 | 40 | 0 | 25 | 30 | 25 | self,transaction | [] | None | {"Expr": 3, "Try": 1} | 3 | 6 | 3 | ["self.setup_transaction", "validate_transaction", "self.fail"] | 0 | [] | The function (check_transaction) defined within the public class called ValidationBase, that inherit another class.The function start at line 25 and ends at 30. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [25.0] and does not return any value. It declares 3.... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_transaction_str_type | def check_transaction_str_type(self, obj: str, key: str) -> None:self.check_transaction({obj: {key: "string"}})self.check_invalid_transaction({obj: {key: 12}}) | 1 | 3 | 3 | 43 | 0 | 32 | 34 | 32 | self,obj,key | [] | None | {"Expr": 2} | 2 | 3 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (check_transaction_str_type) defined within the public class called ValidationBase, that inherit another class.The function start at line 32 and ends at 34. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [32.0] and does not return any value. It de... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_positive_number | def check_positive_number(self, f: Callable) -> None:for good in (1, 1.1, Decimal("1.1")):self.check_transaction(f(good))for bad in ("1.2", "1", -1, -1.1, 0):self.check_invalid_transaction(f(bad)) | 3 | 5 | 2 | 64 | 0 | 36 | 40 | 36 | self,f | [] | None | {"Expr": 2, "For": 2} | 5 | 5 | 5 | ["Decimal", "self.check_transaction", "f", "self.check_invalid_transaction", "f"] | 0 | [] | The function (check_positive_number) defined within the public class called ValidationBase, that inherit another class.The function start at line 36 and ends at 40. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [36.0] and does not return any value. It declare... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_bool | def check_bool(self, obj: str, key: str) -> None:for good in (True, False):self.check_transaction({obj: {key: good}})for bad in ("", 0, "True"):self.check_invalid_transaction({obj: {key: bad}}) | 3 | 5 | 3 | 63 | 0 | 42 | 46 | 42 | self,obj,key | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (check_bool) defined within the public class called ValidationBase, that inherit another class.The function start at line 42 and ends at 46. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [42.0] and does not return any value. It declares 2.0 funct... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | setup_report | def setup_report(self, report: dict[str, Any]) -> None:if "ip_address" not in report:report["ip_address"] = "1.2.3.4"if "tag" not in report:report["tag"] = "chargeback" | 3 | 5 | 2 | 40 | 0 | 48 | 53 | 48 | self,report | [] | None | {"Assign": 2, "If": 2} | 0 | 6 | 0 | [] | 0 | [] | The function (setup_report) defined within the public class called ValidationBase, that inherit another class.The function start at line 48 and ends at 53. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [48.0] and does not return any value.. |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_invalid_report | def check_invalid_report(self, report: dict[str, Any]) -> None:self.setup_report(report)self.check_invalid_report_no_setup(report) | 1 | 3 | 2 | 28 | 0 | 55 | 57 | 55 | self,report | [] | None | {"Expr": 2} | 2 | 3 | 2 | ["self.setup_report", "self.check_invalid_report_no_setup"] | 0 | [] | The function (check_invalid_report) defined within the public class called ValidationBase, that inherit another class.The function start at line 55 and ends at 57. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [55.0] and does not return any value. It declares... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_invalid_report_no_setup | def check_invalid_report_no_setup(self, report: dict[str, Any]) -> None:with self.assertRaises(MultipleInvalid, msg=f"{report} is invalid"):validate_report(report) | 1 | 3 | 2 | 33 | 0 | 59 | 61 | 59 | self,report | [] | None | {"Expr": 1, "With": 1} | 2 | 3 | 2 | ["self.assertRaises", "validate_report"] | 0 | [] | The function (check_invalid_report_no_setup) defined within the public class called ValidationBase, that inherit another class.The function start at line 59 and ends at 61. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [59.0] and does not return any value. It... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_report | def check_report(self, report: dict[str, Any]) -> None:self.setup_report(report)self.check_report_no_setup(report) | 1 | 3 | 2 | 28 | 0 | 63 | 65 | 63 | self,report | [] | None | {"Expr": 2} | 2 | 3 | 2 | ["self.setup_report", "self.check_report_no_setup"] | 0 | [] | The function (check_report) defined within the public class called ValidationBase, that inherit another class.The function start at line 63 and ends at 65. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [63.0] and does not return any value. It declares 2.0 fun... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_report_no_setup | def check_report_no_setup(self, report: dict[str, Any]) -> None:try:validate_report(report)except MultipleInvalid as e:self.fail(f"MultipleInvalid {e.msg} thrown for {report}") | 2 | 5 | 2 | 34 | 0 | 67 | 71 | 67 | self,report | [] | None | {"Expr": 2, "Try": 1} | 2 | 5 | 2 | ["validate_report", "self.fail"] | 0 | [] | The function (check_report_no_setup) defined within the public class called ValidationBase, that inherit another class.The function start at line 67 and ends at 71. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [67.0] and does not return any value. It declare... |
maxmind_minfraud-api-python | ValidationBase | public | 0 | 1 | check_report_str_type | def check_report_str_type(self, key: str) -> None:self.check_report({key: "string"})self.check_invalid_report({key: 12}) | 1 | 3 | 2 | 31 | 0 | 73 | 75 | 73 | self,key | [] | None | {"Expr": 2} | 2 | 3 | 2 | ["self.check_report", "self.check_invalid_report"] | 0 | [] | The function (check_report_str_type) defined within the public class called ValidationBase, that inherit another class.The function start at line 73 and ends at 75. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [73.0] and does not return any value. It declare... |
maxmind_minfraud-api-python | TestTransaction | public | 0 | 1 | test_transaction_without_device | def test_transaction_without_device(self) -> None:transaction = {"account": {"user_id": "usr",},}validate_transaction(transaction) | 1 | 7 | 1 | 24 | 0 | 79 | 85 | 79 | self | [] | None | {"Assign": 1, "Expr": 1} | 1 | 7 | 1 | ["validate_transaction"] | 0 | [] | The function (test_transaction_without_device) defined within the public class called TestTransaction, that inherit another class.The function start at line 79 and ends at 85. 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... |
maxmind_minfraud-api-python | TestAccount | public | 0 | 1 | test_account_user_id | def test_account_user_id(self) -> None:self.check_transaction({"account": {"user_id": "usr"}}) | 1 | 2 | 1 | 21 | 0 | 89 | 90 | 89 | self | [] | None | {"Expr": 1} | 1 | 2 | 1 | ["self.check_transaction"] | 0 | [] | The function (test_account_user_id) defined within the public class called TestAccount, that inherit another class.The function start at line 89 and ends at 90. 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 declare 1.0 fu... |
maxmind_minfraud-api-python | TestAccount | public | 0 | 1 | test_account_username_md5 | def test_account_username_md5(self) -> None:self.check_transaction({"account": {"username_md5": "14c4b06b824ec593239362517f538b29"}},) | 1 | 4 | 1 | 22 | 0 | 92 | 95 | 92 | self | [] | None | {"Expr": 1} | 1 | 4 | 1 | ["self.check_transaction"] | 0 | [] | The function (test_account_username_md5) defined within the public class called TestAccount, that inherit another class.The function start at line 92 and ends at 95. 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 declare 1... |
maxmind_minfraud-api-python | TestAccount | public | 0 | 1 | test_invalid_account_username_md5s | def test_invalid_account_username_md5s(self) -> None:self.check_invalid_transaction({"account": {"username_md5": "14c4b06b824ec593239362517f538b2"}},)self.check_invalid_transaction({"account": {"username_md5": "14c4b06b824ec593239362517f538b29a"}},) | 1 | 7 | 1 | 37 | 0 | 97 | 103 | 97 | self | [] | None | {"Expr": 2} | 2 | 7 | 2 | ["self.check_invalid_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_invalid_account_username_md5s) defined within the public class called TestAccount, that inherit another class.The function start at line 97 and ends at 103. 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... |
maxmind_minfraud-api-python | AddressBase | public | 0 | 1 | test_strings | def test_strings(self) -> None:for key in ("first_name","last_name","company","address","address_2","city","postal","phone_number",):self.check_transaction_str_type(self.type, key) | 2 | 12 | 1 | 39 | 0 | 109 | 120 | 109 | self | [] | None | {"Expr": 1, "For": 1} | 1 | 12 | 1 | ["self.check_transaction_str_type"] | 0 | [] | The function (test_strings) defined within the public class called AddressBase, that inherit another class.The function start at line 109 and ends at 120. It contains 12 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 declare 1.0 functio... |
maxmind_minfraud-api-python | AddressBase | public | 0 | 1 | test_region | def test_region(self) -> None:for region in ("A", "AA", "AAA", "ZZZZ"):self.check_transaction({self.type: {"region": region}})for invalid in ("", "AAAAA", 1, "aaa"):self.check_invalid_transaction({self.type: {"region": invalid}}) | 3 | 5 | 1 | 65 | 0 | 122 | 126 | 122 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_region) defined within the public class called AddressBase, that inherit another class.The function start at line 122 and ends at 126. It contains 5 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 2.0 function... |
maxmind_minfraud-api-python | AddressBase | public | 0 | 1 | test_country | def test_country(self) -> None:for country in ("US", "CA", "GB"):self.check_transaction({self.type: {"country": country}})for invalid in ("", "U1", "USA", 1, "11", "us"):self.check_invalid_transaction({self.type: {"country": invalid}}) | 3 | 5 | 1 | 67 | 0 | 128 | 132 | 128 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_country) defined within the public class called AddressBase, that inherit another class.The function start at line 128 and ends at 132. It contains 5 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 2.0 functio... |
maxmind_minfraud-api-python | AddressBase | public | 0 | 1 | test_phone_country_code | def test_phone_country_code(self) -> None:for code in (1, "1", "2341"):self.check_transaction({self.type: {"phone_country_code": code}})for invalid in ("", "12345", "U"):self.check_invalid_transaction({self.type: {"phone_country_code": invalid}}) | 3 | 5 | 1 | 61 | 0 | 134 | 138 | 134 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_phone_country_code) defined within the public class called AddressBase, that inherit another class.The function start at line 134 and ends at 138. It contains 5 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 ... |
maxmind_minfraud-api-python | TestShippingAddress | public | 0 | 1 | test_delivery_speed | def test_delivery_speed(self) -> None:for speed in ("same_day", "overnight", "expedited", "standard"):self.check_transaction({self.type: {"delivery_speed": speed}})for invalid in ("fast", "slow", ""):self.check_invalid_transaction({self.type: {"delivery_speed": invalid}}) | 3 | 5 | 1 | 63 | 0 | 148 | 152 | 148 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_delivery_speed) defined within the public class called TestShippingAddress, that inherit another class.The function start at line 148 and ends at 152. It contains 5 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 decla... |
maxmind_minfraud-api-python | AddressBase | public | 0 | 1 | test_country | def test_country(self) -> None:for code in ("CA", "US"):self.check_transaction({"credit_card": {"country": code}})for invalid in (1, None, "", "A1", "Canada"):self.check_invalid_transaction({"credit_card": {"country": invalid}}) | 3 | 5 | 1 | 59 | 0 | 156 | 160 | 156 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_country) defined within the public class called AddressBase, that inherit another class.The function start at line 156 and ends at 160. It contains 5 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 2.0 functio... |
maxmind_minfraud-api-python | TestCreditCard | public | 0 | 1 | test_issuer_id_number | def test_issuer_id_number(self) -> None:for iin in ("123456", "532313", "88888888"):self.check_transaction({"credit_card": {"issuer_id_number": iin}})for invalid in ("12345", "1234567", 123456, "12345a"):self.check_invalid_transaction({"credit_card": {"issuer_id_number": invalid}},) | 3 | 7 | 1 | 60 | 0 | 162 | 168 | 162 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 7 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_issuer_id_number) defined within the public class called TestCreditCard, that inherit another class.The function start at line 162 and ends at 168. It contains 7 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... |
maxmind_minfraud-api-python | TestCreditCard | public | 0 | 1 | test_last_digits | def test_last_digits(self) -> None:for last_digits in ("1234", "9323", "34"):self.check_transaction({"credit_card": {"last_digits": last_digits}})for invalid in ("12345", "123", 1234, "123a"):self.check_invalid_transaction({"credit_card": {"last_digits": invalid}})self.check_transaction({"credit_card": {"issuer_id_numb... | 3 | 17 | 1 | 135 | 0 | 170 | 186 | 170 | self | [] | None | {"Expr": 6, "For": 2} | 6 | 17 | 6 | ["self.check_transaction", "self.check_invalid_transaction", "self.check_transaction", "self.check_transaction", "self.check_transaction", "self.check_transaction"] | 0 | [] | The function (test_last_digits) defined within the public class called TestCreditCard, that inherit another class.The function start at line 170 and ends at 186. It contains 17 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 6.0... |
maxmind_minfraud-api-python | TestCreditCard | public | 0 | 1 | test_last_4_digits | def test_last_4_digits(self) -> None:for last_digits in ("1234", "9323", "34"):self.check_transaction({"credit_card": {"last_4_digits": last_digits}})for invalid in ("12345", "123", 1234, "123a"):self.check_invalid_transaction({"credit_card": {"last_4_digits": invalid}}) | 3 | 5 | 1 | 59 | 0 | 188 | 192 | 188 | self | [] | None | {"Expr": 2, "For": 2} | 2 | 5 | 2 | ["self.check_transaction", "self.check_invalid_transaction"] | 0 | [] | The function (test_last_4_digits) defined within the public class called TestCreditCard, that inherit another class.The function start at line 188 and ends at 192. It contains 5 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 2.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.