Showing 2,441 of 6,157 total issues
CRUDCollection
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class CRUDCollection extends PureComponent<
CRUDCollectionProps,
CRUDCollectionState
> {
constructor(props: CRUDCollectionProps) {
Consider simplifying this complex logical expression. Open
Open
if (
importLoading ||
(alreadyExists.length && !confirmedOverwrite) ||
(passwordsNeeded.length && JSON.stringify(passwords) === '{}') ||
(sshPasswordNeeded.length &&
Function transformEventAnnotation
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transformEventAnnotation(
layer: EventAnnotationLayer,
data: TimeseriesDataRecord[],
annotationData: AnnotationData,
colorScale: CategoricalColorScale,
Function renderDropdown
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderDropdown = () => {
const qe = queryEditor;
const successful = latestQuery?.state === 'success';
const scheduleToolTip = successful
? t('Schedule the query periodically')
Function renderComponent
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderComponent = (id: string) => {
const isRemoved = !!removedFilters[id];
const isErrored = erroredFilters.includes(id);
const isActive = currentFilterId === id;
const classNames = [];
File SaveModal.test.jsx
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File exploreReducer.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File api.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File schemas.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File LeftPanel.test.tsx
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File switchboard.test.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File 2020-10-05_18-10_af30ca79208f_collapse_alerting_models_into_a_single_.py
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File controlPanel.tsx
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 renderValueConfiguration
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderValueConfiguration() {
const { annotationType, sourceType, value } = this.state;
let label = '';
let description = '';
if (requiresQuery(sourceType)) {
Function renderTab
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderTab() {
const {
component,
parentComponent,
index,
Function TimeFilterPlugin
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function TimeFilterPlugin(props: PluginFilterTimeProps) {
const {
setDataMask,
setHoveredFilter,
unsetHoveredFilter,
Function generateMockPayload
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateMockPayload = (dashboard = true) => {
const mockPayload = {
active: false,
context_markdown: 'string',
creation_method: 'alerts_reports',
File SqlEditorLeftBar.test.tsx
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 upgrade
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
for slc in session.query(Slice).filter(Slice.viz_type == "table"):
- 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 upgrade
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
dash_to_migrate = defaultdict(list)
- 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"