Showing 126 of 683 total issues
Function _builds_with_jobs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _builds_with_jobs(self, jobs: Jobs) -> Iterator[tuple[Build, Job]]:
"""Recursively return the builds and their respective jobs, for all selected jobs."""
for job in self._jobs(jobs):
for build in job.get("builds", []):
if self._include_build(build): # pragma: no cover # can be overridden
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function check_logos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_logos(self) -> None:
"""Check that a logo exists for each source and vice versa."""
logos_path = pathlib.Path(__file__).parent.parent / "logos"
for source_type in self.sources:
logo_path = logos_path / f"{source_type}.png"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function encrypt_issue_tracker_credentials
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def encrypt_issue_tracker_credentials(public_key: str, *reports: dict):
"""Encrypt all issue tracker credentials in the reports."""
for report in reports:
for secret_attribute in ("password", "private_token"):
if secret_attribute in report.get("issue_tracker", {}).get("parameters", {}):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function summarize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def summarize(self, measurements: dict[MetricId, list[Measurement]]) -> dict:
"""Create a summary dict of this report."""
summary = dict(self)
summary["summary"] = {"red": 0, "green": 0, "yellow": 0, "grey": 0, "blue": 0, "white": 0}
summary["subjects"] = {subject.uuid: subject.summarize(measurements) for subject in self.subjects}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function showMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function showMessage(type, title, description, messageId) {
const hideToasts = registeredURLSearchParams().get("hide_toasts")
if (hideToasts !== "true") {
const toastMessage =
title && description ? (
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function SubjectTableRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function SubjectTableRow({
changed_fields,
dates,
handleSort,
index,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"