Showing 126 of 683 total issues
Avoid too many return
statements within this function. Open
return null
Avoid too many return
statements within this function. Open
return fetch_server_api("get", `changelog/${nr_changes}`)
Avoid too many return
statements within this function. Open
return <MultipleChoiceInput {...parameter_props} options={dropdownOptions(parameter_values)} />
Avoid too many return
statements within this function. Open
return <StringInput {...parameter_props} error={warning} />
Function niceNumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function niceNumber(number) {
let rounded_numbers = [10, 12, 15, 20, 30, 50, 75]
do {
for (let rounded_number of rounded_numbers) {
if (number <= (9 * rounded_number) / 10) {
- 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 ActionAndItemPickerButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function ActionAndItemPickerButton({ action, itemType, onChange, get_options, icon }) {
const [options, setOptions] = useState([])
const breadcrumbProps = { report: "report" }
if (itemType !== "report") {
- 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 __entities
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __entities(cls, tree: Element, test_results_to_count: list[str]) -> Entities:
"""Transform the test methods into entities."""
# Unfortunately, there's no DTD or XSD for the testng-result.xml format (see
# https://github.com/cbeust/testng/issues/2371), so we have to make some assumptions about elements and
# attributes here. We use element.attribute[key] to access attributes that we assume are mandatory so that we
- 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 metric_section
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def metric_section(metric: MetricNotificationData, report_url: str) -> pymsteams.cardsection:
"""Create a section for a metric status change."""
section = pymsteams.cardsection()
section.activityTitle(metric.metric_name)
section.activitySubtitle(metric.subject_name)
- 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 SettingsMenuItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function SettingsMenuItem({ active, children, disabled, disabledHelp, help, onClick, onClickData }) {
// A menu item that can can show help when disabled so users can see why the menu item is disabled
const props = {
active: active,
color: activeColor,
- 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 change_source_parameter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def change_source_parameter( # noqa: PLR0913
reports,
items,
parameter_key: str,
old_value,
- 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 get_subclass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_subclass(cls, source_type: str, metric_type: str) -> type["SourceCollector"] | None:
"""Return the subclass registered for the source/metric name.
First try to find a match on both source type and metric type. If no match is found, return the generic
collector for the source type.
- 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 SortColumnMenuItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function SortColumnMenuItem({ column, disabled, sortColumn, sortDirection, handleSort, help }) {
let sortIndicator = null
if (sortColumn.equals(column) && sortDirection.value) {
// We use a triangle because the sort down and up icons are not at the same height
const iconDirection = sortDirection.equals("ascending") ? "up" : "down"
- 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 DeltaCell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function DeltaCell({ dateOrderAscending, index, metric, metricValue, previousValue, status }) {
const dataModel = useContext(DataModel)
let label = null
if (index > 0 && previousValue !== "?" && metricValue !== "?" && previousValue !== metricValue) {
// Note that the delta cell only gets content if the previous and current values are both available and unequal
- 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 renderAddDropdownButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function renderAddDropdownButton(nrItems = 2, totalItems = 10, usedItemKeys = []) {
const mockCallback = jest.fn()
const itemSubtypes = []
let allItemSubtypes
if (nrItems < totalItems) {
- 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_source_credentials
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def encrypt_source_credentials(public_key: str, *reports: dict):
"""Encrypt all source credentials in the reports."""
for source in iter_sources(*reports):
for parameter_key in __password_parameter_keys(source):
password = source["parameters"][parameter_key]
- 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 latest_report_for_uuids
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def latest_report_for_uuids(all_reports: list[Report], *uuids: ItemId) -> list[Report]:
"""Return the report for given child entity uuids.
The uuids can be of a report, subject, metric or source.
The returned results will be in order of provided uuids.
- 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 sources_with_branch_parameter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sources_with_branch_parameter(report: dict):
"""Return the sources with a branch parameter."""
for metric in metrics(report, list(METRICS_WITH_SOURCES_WITH_BRANCH_PARAMETER.keys())):
for source in metric.get("sources", {}).values():
if source["type"] in METRICS_WITH_SOURCES_WITH_BRANCH_PARAMETER[metric["type"]]:
- 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 MetricSummaryCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function MetricSummaryCard({ header, onClick, selected, summary, maxY }) {
const [boundingBox, ref] = useBoundingBox()
const animate = { duration: 0, onLoad: { duration: 0 } }
const colors = STATUSES.map((status) => STATUS_COLORS_RGB[status])
const labelColor = useContext(DarkMode) ? "darkgrey" : "rgba(120, 120, 120)"
- 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 decrypt_issue_tracker_credentials
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decrypt_issue_tracker_credentials(private_key: str, *reports: dict):
"""Decrypt 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 ReadOnlyInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ReadOnlyInput({ error, label, placeholder, prefix, required, value, type, unit }) {
return (
<Form.Input
error={error || (required && value === "")}
fluid
- 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"