Showing 2,441 of 6,157 total issues
Function useDatasetMetadataBar
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const useDatasetMetadataBar = ({
dataset: datasetProps,
datasetId,
}: UseDatasetMetadataBarProps) => {
const theme = useTheme();
- 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 AnnotationLayersList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function AnnotationLayersList({
addDangerToast,
addSuccessToast,
user,
}: AnnotationLayersListProps) {
- 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 parseErrorJson
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function parseErrorJson(responseJson: JsonObject): ClientErrorObject {
let error = { ...responseJson };
// Backwards compatibility for old error renderers with the new error object
if (error.errors && error.errors.length > 0) {
error.error = error.description = error.errors[0].message;
- 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 actions.REFRESH_QUERIES
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
[actions.REFRESH_QUERIES]() {
let newQueries = { ...state.queries };
// Fetch the updates to the queries present in the store.
let change = false;
let { queriesLastUpdate } = state;
Function overwriteDashboard
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
overwriteDashboard() {
const {
dashboardTitle,
layout: positions,
colorScheme,
Function createDeckGLComponent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createDeckGLComponent(
getLayer: getLayerType<unknown>,
getPoints: getPointsType,
) {
// Higher order component
Function promises
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const promises = currentTimeRangeFilters.map(filter => {
const nonCustomNorInheritShifts =
shiftsArray.filter(
(shift: string) => shift !== 'custom' && shift !== 'inherit',
) || [];
Function ViewQueryModalFooter
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ViewQueryModalFooter: FC<ViewQueryModalFooterProps> = (props: {
closeModal: () => void;
changeDatasource: () => void;
datasource: SimpleDataSource;
}) => {
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ModalTrigger
ref={this.modal}
triggerNode={this.props.triggerNode}
File mysql.py
has 253 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
File lib.py
has 253 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
File controlPanel.tsx
has 253 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
File exploreUtils.test.jsx
has 252 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
File transformProps.ts
has 252 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 updateColumns
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateColumns(cols) {
// cols: Array<{column_name: string; is_dttm: boolean; type: string;}>
const { databaseColumns } = this.state;
const databaseColumnNames = cols.map(col => col.column_name);
const currentCols = databaseColumns.reduce(
Function startPeriodicRender
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
startPeriodicRender(interval) {
let intervalMessage;
if (interval) {
const { dashboardInfo } = this.props;
Function transformedData
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
(data_point, index) => {
const name = groupbyLabels
.map(column => `${verboseMap[column] || column}: ${data_point[column]}`)
.join(', ');
columnsLabelMap.set(
Function DeckGLGeoJson
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeckGLGeoJson = (props: DeckGLGeoJsonProps) => {
const containerRef = useRef<DeckGLContainerHandle>();
const setTooltip = useCallback((tooltip: TooltipProps['tooltip']) => {
const { current } = containerRef;
if (current) {
Function Control
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Control(props: ControlProps) {
const {
actions: { setControlValue },
name,
type,
Function useNativeFilters
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useNativeFilters = () => {
const [isInitialized, setIsInitialized] = useState(false);
const canEdit = useSelector<RootState, boolean>(
({ dashboardInfo }) => dashboardInfo.dash_edit_perm,
);