Showing 2,441 of 6,157 total issues
Function replace
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def replace(source, target):
bind = op.get_bind()
session = db.Session(bind=bind)
query = (
- 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_type_generator
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_type_generator( # pylint: disable=too-many-return-statements,too-many-branches
sqltype: sqlalchemy.sql.sqltypes,
) -> Callable[[], Any]:
if isinstance(sqltype, sqlalchemy.dialects.mysql.types.TINYINT):
return lambda: random.choice([0, 1])
- 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 port_translate_filter_func
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def port_translate_filter_func(
col: Column, operator: FilterOperator, values: list[Any]
) -> Any:
"""
Convert a passed in column, FilterOperator
- 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_timestamp_expr
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_timestamp_expr(
cls,
col: ColumnClause,
pdf: str | None,
time_grain: str | None,
- 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_viz_annotation_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_viz_annotation_data(
annotation_layer: dict[str, Any], force: bool
) -> dict[str, Any]:
# pylint: disable=import-outside-toplevel
from superset.commands.chart.data.get_data_command import ChartDataCommand
- 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 validate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def validate(self) -> None:
exceptions: list[ValidationError] = []
dashboard_ids = self._properties.get("dashboards")
owner_ids: Optional[list[int]] = self._properties.get("owners")
tag_ids: Optional[list[int]] = self._properties.get("tags")
- 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 transformProps
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export default function transformProps(
chartProps: EchartsPieChartProps,
): PieChartTransformedProps {
const {
formData,
- 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 useListViewResource
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function useListViewResource<D extends object = any>(
resource: string,
resourceLabel: string, // resourceLabel for translations
handleErrorMsg: (errorMsg: string) => void,
infoEnable = true,
- 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 EmptyState
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export default function EmptyState({
tableName,
tab,
otherTabTitle,
}: EmptyStateProps) {
- 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 Welcome
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function Welcome({ user, addDangerToast }: WelcomeProps) {
const canReadSavedQueries = userHasPermission(user, 'SavedQuery', 'can_read');
const userid = user.userId;
const id = userid!.toString(); // confident that user is not a guest user
const params = rison.encode({ page_size: 6 });
- 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 naturalSort
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const naturalSort = (as, bs) => {
// nulls first
if (bs !== null && as === null) {
return -1;
}
Function updateActive
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateActive() {
const delay = d3.event.altKey ? 3000 : 300;
legendWrap.datum(legendData(datum)).call(legend);
const nArcSt = computeArcStates(datum);
inTransition = true;
Function constructor
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
datasource: {
...props.datasource,
File post_processing.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
Function HeaderWithRadioGroup
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function HeaderWithRadioGroup(props: HeaderWithRadioGroupProps) {
const { headerTitle, groupTitle, groupOptions, value, onChange } = props;
const theme = useTheme();
const [popoverVisible, setPopoverVisible] = useState(false);
File index.tsx
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
width,
height,
aggregatorName,
Function transformProps
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function transformProps(chartProps) {
const {
width,
height,
formData,
Function load_deck_dash
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_deck_dash() -> None: # pylint: disable=too-many-statements
print("Loading deck.gl dashboard")
slices = []
table = get_table_connector_registry()
tbl = db.session.query(table).filter_by(table_name="long_lat").first()
Function getBasicColorFormatter
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getBasicColorFormatter = memoizeOne(function getBasicColorFormatter(
originalData: DataRecord[] | undefined,
originalColumns: DataColumnMeta[],
selectedColumns?: ConditionalFormattingConfig[],
) {