airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function validate_parameters has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_parameters(
        cls, properties: BasicPropertiesType
    ) -> list[SupersetError]:
        # The newest versions of superset send a "properties" object with a
        # parameters key, instead of just the parameters, so we hack to be compatible
Severity: Minor
Found in superset/db_engine_specs/databend.py - About 2 hrs to fix

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_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def get_data(self, df: pd.DataFrame) -> VizData:  # pylint: disable=too-many-locals
        if df.empty:
            return None

        metrics = self.metric_labels
Severity: Minor
Found in superset/viz.py - About 2 hrs to fix

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 handle_cursor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def handle_cursor(cls, cursor: Any, query: Query) -> None:
        """Stop query and updates progress information"""

        query_id = query.id
        unfinished_states = (
Severity: Minor
Found in superset/db_engine_specs/impala.py - About 2 hrs to fix

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 _file_content has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _file_content(model: Dashboard) -> str:
        payload = model.export_to_dict(
            recursive=False,
            include_parent_ref=False,
            include_defaults=True,
Severity: Minor
Found in superset/commands/dashboard/export.py - About 2 hrs to fix

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 _refresh_catalogs has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _refresh_catalogs(
        self,
        database: Database,
        original_database_name: str,
        ssh_tunnel: SSHTunnel | None,
Severity: Minor
Found in superset/commands/database/update.py - About 2 hrs to fix

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 run has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self) -> dict[str, Any]:
        self.validate()
        chart: Slice = self._chart_or_id  # type: ignore

        try:
Severity: Minor
Found in superset/commands/chart/warm_up_cache.py - About 2 hrs to fix

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 getBaselineSeriesForStream has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const getBaselineSeriesForStream = (
  series: [string | number, number][][],
  seriesType: EchartsTimeseriesSeriesType,
) => {
  const seriesLength = series[0].length;

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 SaveDatasetModal has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const SaveDatasetModal = ({
  visible,
  onHide,
  buttonTextOnSave,
  buttonTextOnOverwrite,
Severity: Minor
Found in superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx - About 2 hrs to fix

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 getUrlParam has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export function getUrlParam({ name, type }: UrlParam): unknown {
  const urlParam = new URLSearchParams(window.location.search).get(name);
  switch (type) {
    case 'number':
      if (!urlParam) {
Severity: Minor
Found in superset-frontend/src/utils/urlUtils.ts - About 2 hrs to fix

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 FilterBarSettings has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const FilterBarSettings = () => {
  const dispatch = useDispatch();
  const theme = useTheme();
  const isCrossFiltersEnabled = useSelector<RootState, boolean>(
    ({ dashboardInfo }) => dashboardInfo.crossFiltersEnabled,

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 DetailsPanelPopover has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const DetailsPanelPopover = ({
  appliedCrossFilterIndicators = [],
  appliedIndicators = [],
  onHighlightFilterSource,
  children,

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

File index.tsx has 267 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 handleDrop has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function handleDrop(props, monitor, Component) {
      // this may happen due to throttling
      if (!Component.mounted) return undefined;
    
      Component.setState(() => ({ dropIndicator: null }));
    Severity: Major
    Found in superset-frontend/src/dashboard/components/dnd/handleDrop.js - About 2 hrs to fix

      Function getBaselineSeriesForStream has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getBaselineSeriesForStream = (
        series: [string | number, number][][],
        seriesType: EchartsTimeseriesSeriesType,
      ) => {
        const seriesLength = series[0].length;

        Function useTabId has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function useTabId() {
          const [tabId, setTabId] = useState<string>();
        
          function isStorageAvailable() {
            try {
        Severity: Major
        Found in superset-frontend/src/hooks/useTabId.ts - About 2 hrs to fix

          Function render has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { addedAnnotationIndex } = this.state;
              const addedAnnotation =
                addedAnnotationIndex !== null
                  ? this.props.value[addedAnnotationIndex]

            File ResizableContainer.jsx has 266 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 handleDropdownNavigation has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const handleDropdownNavigation = (
                e: KeyboardEvent<HTMLElement>,
                dropdownIsOpen: boolean,
                menu: ReactElement,
                toggleDropdown: () => void,

                File AddSliceCard.tsx has 264 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

                  DatasourceEditor has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class DatasourceEditor extends PureComponent {
                    constructor(props) {
                      super(props);
                      this.state = {
                        datasource: {
                  Severity: Minor
                  Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language