File _version.py
has 495 lines of code (exceeds 250 allowed). Consider refactoring.
Function git_pieces_from_vcs
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
def git_pieces_from_vcs(
tag_prefix: str,
root: str,
verbose: bool,
runner: Callable = run_command
Function git_versions_from_keywords
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
def git_versions_from_keywords(
keywords: Dict[str, str],
tag_prefix: str,
verbose: bool,
) -> Dict[str, Any]:
Function run_command
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def run_command(
commands: List[str],
args: List[str],
cwd: Optional[str] = None,
verbose: bool = False,
Function git_get_keywords
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
"""Extract version information from the given file."""
Function render_pep440_branch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def render_pep440_branch(pieces: Dict[str, Any]) -> str:
"""TAG[[.dev0]+DISTANCE.gHEX[.dirty]] .
The ".dev0" means not master branch. Note that .dev0 sorts backwards
(a feature branch will appear "older" than the master branch).
Function render_pep440_post_branch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
"""TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .
The ".dev0" means not master branch.
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
"""Render the given version pieces into the requested style."""
if pieces["error"]:
return {"version": "unknown",
"full-revisionid": pieces.get("long"),
Function git_pieces_from_vcs
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
def git_pieces_from_vcs(
tag_prefix: str,
root: str,
verbose: bool,
runner: Callable = run_command
Function render_pep440
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def render_pep440(pieces: Dict[str, Any]) -> str:
"""Build up version string, with post-release "local version identifier".
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Function render_pep440_post
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def render_pep440_post(pieces: Dict[str, Any]) -> str:
"""TAG[.postDISTANCE[.dev0]+gHEX] .
The ".dev0" means dirty. Note that .dev0 sorts backwards
(a dirty tree will appear "older" than the corresponding clean one),
Function render_pep440_old
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def render_pep440_old(pieces: Dict[str, Any]) -> str:
"""TAG[.postDISTANCE[.dev0]] .
The ".dev0" means dirty.
Function render_pep440_pre
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def render_pep440_pre(pieces: Dict[str, Any]) -> str:
"""TAG[.postN.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post0.devDISTANCE
Function run_command
has 6 arguments (exceeds 4 allowed). Consider refactoring.
def run_command(
Avoid too many return
statements within this function.
return {"version": "0+unknown", "full-revisionid": None,
Function get_versions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def get_versions() -> Dict[str, Any]:
"""Get version information or return default if unable to do so."""
There are no issues that match your filters.