Showing 2,441 of 6,157 total issues
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
className,
debounceTime,
width,
Function constructor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(adhocFilter) {
this.expressionType = adhocFilter.expressionType || ExpressionTypes.Simple;
if (this.expressionType === ExpressionTypes.Simple) {
this.subject = adhocFilter.subject;
this.operator = adhocFilter.operator?.toUpperCase();
Function CREATE_TOP_LEVEL_TABS
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
[CREATE_TOP_LEVEL_TABS](state, action) {
const {
payload: { dropResult },
} = action;
const { source, dragging } = dropResult;
Function treeBuilder
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function treeBuilder(
data: DataRecord[],
groupBy: string[],
metric: string,
secondaryMetric?: string,
Function useInstance
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useInstance<D extends object>(instance: TableInstance<D>) {
const {
dispatch,
state: { sticky },
data,
Function getLayer
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getLayer(
formData: PolygonFormData,
payload: JsonObject,
onAddFilter: HandlerFunction,
setTooltip: (tooltip: TooltipProps['tooltip']) => void,
Function renderHeader
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderHeader(maxHeight: number) {
const { bigNumber, headerFormatter, width, colorThresholdFormatters } =
this.props;
// @ts-ignore
const text = bigNumber === null ? t('No data') : headerFormatter(bigNumber);
Function transformProps
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function transformProps(
chartProps: PluginFilterSelectChartProps,
) {
const {
formData,
Function useAnnotations
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useAnnotations(params: FetchValidationQueryParams) {
const { sql, dbId, schema, templateParams } = params;
const debouncedSql = useDebounceValue(sql, VALIDATION_DEBOUNCE_MS);
const hasValidator = useSelector<SqlLabRootState>(({ sqlLab, common }) =>
// Check whether or not we can validate the current query based on whether
Function AsyncEsmComponent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function AsyncEsmComponent<
P = PlaceholderProps,
M = ComponentType<P> | { default: ComponentType<P> },
>(
/**
Function DownloadMenuItems
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DownloadMenuItems = (props: DownloadMenuItemProps) => {
const {
pdfMenuItemTitle,
imageMenuItemTitle,
logEvent,
Function constructor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(config: ChartMetadataConfig) {
const {
name,
canBeAnnotationTypes = [],
credits = [],
Function renameOperator
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const renameOperator: PostProcessingFactory<PostProcessingRename> = (
formData,
queryObject,
) => {
const metrics = ensureIsArray(queryObject.metrics);
Function upgrade
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
tables = [
- 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 copy_dashboard
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def copy_dashboard(
cls, original_dash: Dashboard, data: dict[str, Any]
) -> Dashboard:
if is_feature_enabled("DASHBOARD_RBAC") and not security_manager.is_owner(
original_dash
- 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 _pre_action
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _pre_action(self) -> None:
self.data["contributionMode"] = "row" if self.data.get("contribution") else None
self.data["zoomable"] = self.data.get("show_brush") == "yes"
self.data["markerEnabled"] = self.data.get("show_markers") or False
self.data["y_axis_showminmax"] = 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 scan_dashboard_positions_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def scan_dashboard_positions_data(positions):
positions_by_row_id = {}
for position in positions:
row = position["row"]
position["col"] = min(position["col"], TOTAL_COLUMNS)
- 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 adhoc_column_to_sqla
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def adhoc_column_to_sqla( # pylint: disable=too-many-locals
self,
col: AdhocColumn,
force_type_check: bool = False,
template_processor: BaseTemplateProcessor | None = 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 prophet
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def prophet( # pylint: disable=too-many-arguments
df: DataFrame,
time_grain: str,
periods: int,
confidence_interval: float,
- 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_translation_func
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def port_translation_func(req: AdvancedDataTypeRequest) -> AdvancedDataTypeResponse:
"""
Convert a passed in AdvancedDataTypeRequest to a AdvancedDataTypeResponse
"""
resp: AdvancedDataTypeResponse = {
- 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"