Showing 142 of 681 total issues
Function hide_credentials
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def hide_credentials(data_model, *reports) -> None:
"""Hide the credentials in the reports. The data model must be passed so hiding also works when time traveling."""
for source in iter_sources(*reports):
for parameter_key in __password_parameter_keys(source, data_model):
source["parameters"][parameter_key] = CREDENTIALS_REPLACEMENT_TEXT
- 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_parameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_parameters(self) -> Self:
"""Check that if the source has a landing URL parameter it also has a URL parameter."""
if "landing_url" in self.parameters and "url" not in self.parameters:
msg = f"Source {self.name} has a landing URL but no URL"
raise ValueError(msg)
- 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 CardDashboard
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function CardDashboard({ cards, initialLayout, saveLayout }) {
const cols = 32
const cardWidth = 4
const cardHeight = 6
const [mousePos, setMousePos] = useState([0, 0, 0])
- 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 add_source_parameter_hash_to_latest_measurement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_source_parameter_hash_to_latest_measurement(database: Database, report) -> int:
"""Add source parameter hashes to the latest measurements. Return the number of measurements changed."""
# Added after Quality-time v5.12.0, see https://github.com/ICTU/quality-time/issues/8736
count = 0
for subject in subjects(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 create_issue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_issue(self, summary: str, description: str = "") -> tuple[str, str]:
"""Create a new issue and return its key or an error message if creating the issue failed."""
project_key = self.issue_parameters.project_key
issue_type = self.issue_parameters.issue_type
labels = self.issue_parameters.issue_labels
- 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 verify_user
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def verify_user(database: Database, username: str, password: str) -> User:
"""Authenticate the user and return whether they are authorized to login and their email address."""
ldap_config = get_ldap_config(username)
try:
ldap_servers = [Server(ldap_url, get_info=ALL) for ldap_url in ldap_config.get("ldap_urls")]
- 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 TrendGraph
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function TrendGraph({ metric, measurements, loading }) {
const dataModel = useContext(DataModel)
const darkMode = useContext(DarkMode)
const chartHeight = 250
const estimatedTotalChartHeight = chartHeight + 200 // Estimate of the height including title and axis
- 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 deltaDescription
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function deltaDescription(dataModel, metric, scale, delta, improved, oldValue, newValue) {
Function change_source_parameter
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def change_source_parameter( # noqa: PLR0913
Function datetime_from_parts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def datetime_from_parts( # noqa: PLR0913
Function sort
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function sort(column, columnType, setColumnType, setSortColumn, setSortDirection, sortColumn, sortDirection) {
Function sortMetrics
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function sortMetrics(dataModel, metrics, sortDirection, sortColumn, report, measurements) {
Function sortedEntities
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function sortedEntities(columnType, sortColumn, sortDirection, source) {
let entities = Array.from(source.entities)
if (sortColumn !== null) {
let parse
if (sortColumn === "entity_status") {
- 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 summarizeReportOnDate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function summarizeReportOnDate(dataModel, settings, report, measurements, date, tag) {
Function set_source_entity_attribute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function set_source_entity_attribute(metric_uuid, source_uuid, entity_key, attribute, value, reload) {
Function SourceEntity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function SourceEntity({
metric_uuid,
source_uuid,
hide_ignored_entities,
entity,
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __parse_test_results
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __parse_test_results(self, json) -> Generator:
"""Yield dicts with test result (applicable/incomplete/violations/passes) as key and rules as values."""
if isinstance(json, list):
if json and "tags" in json[0]:
yield {"violations": json} # The items in the list are violated rules
- 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 issuePopupContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function issuePopupContent(issueStatus) {
let popupContent = <TimeAgoWithDate date={issueStatus.created}>Created</TimeAgoWithDate>
if (issueStatus.updated) {
popupContent = (
<>
- 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 EditableTextInput
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function EditableTextInput(props) {
let { label, required, set_value, ...otherProps } = props
const initialValue = props.value || ""
const [text, setText] = useState(initialValue)
- 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"