NChechulin/python-yandex-contest-tools

View on GitHub

Showing 4 of 4 total issues

Function __validate_correct_shortcut has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def __validate_correct_shortcut(self, fr: str, to: str):
if is_number(fr) and is_number(to):
if fr > to:
print(info_strings.ERR_WRONG_NUMBER_RANGE_SPECIFIED)
exit(1)
Severity: Minor
Found in src/config.py - About 1 hr to fix

Function __parse_tasks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def __parse_tasks(self, tasks: Dict) -> List[Task]:
"""Parses tasks from config dict"""
result = []
for name, params in tasks.items():
required_tokens = params.get("required_tokens", [])
Severity: Minor
Found in src/config.py - About 35 mins to fix

Function __parse_tasks_shortcut has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def __parse_tasks_shortcut(
self, shortcut: str, required_tokens: List[str], banned_tokens: List[str]
) -> List[Task]:
"""Parses tasks with shortcut like 1-4 into multiple tasks"""
result = []
Severity: Minor
Found in src/config.py - About 35 mins to fix

Function _validate_required_tokens has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _validate_required_tokens(
file_path: Path,
required_tokens: List[str],
) -> Optional[RequiredTokensValidationError]:
"""Checks the submission and returns an Error if at least one of the required tokens is not present"""
Severity: Minor
Found in src/submission_validation.py - About 35 mins to fix
Severity
Category
Status
Source
Language