airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File ChartContextMenu.tsx has 291 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 AnnotationModal.tsx has 291 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
    Severity: Minor
    Found in superset-frontend/src/features/annotations/AnnotationModal.tsx - About 3 hrs to fix

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

        function ParallelCoordinates(element, props) {
          const {
            data,
            width,
            height,

          Function constructor has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor(props) {
              super(props);
              const {
                name,
                annotationType,

            Function processComparisonColumns has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                .map(col => {
                  const {
                    datasource: { columnFormats, currencyFormats },
                    rawFormData: { column_config: columnConfig = {} },
                  } = props;
            Severity: Major
            Found in superset-frontend/plugins/plugin-chart-table/src/transformProps.ts - About 2 hrs to fix

              File index.tsx has 290 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
              Severity: Minor
              Found in superset-frontend/src/SqlLab/components/QueryTable/index.tsx - About 2 hrs to fix

                Function onSave has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const onSave = () => {
                    // Notification Settings
                    const recipients: Recipient[] = [];
                
                    notificationSettings.forEach(setting => {
                Severity: Major
                Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 2 hrs to fix

                  Function onDownloadScreenshot has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const onDownloadScreenshot = () => {
                      let retries = 0;
                  
                      const toastIntervalId = setInterval(
                        () => printLoadingToast(),

                    Function CrossFilter has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const CrossFilter = (props: {
                      filter: CrossFilterIndicator;
                      orientation: FilterBarOrientation;
                      last?: boolean;
                    }) => {

                      File ScopingModal.tsx has 290 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 289 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 AlteredSliceTag has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const AlteredSliceTag: FC<AlteredSliceTagProps> = props => {
                            const [rows, setRows] = useState<RowType[]>([]);
                            const [hasDiffs, setHasDiffs] = useState<boolean>(false);
                          
                            const getDiffs = useCallback(() => {
                          Severity: Major
                          Found in superset-frontend/src/components/AlteredSliceTag/index.tsx - About 2 hrs to fix

                            Function config has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const config = (contentType: ContentType) => {
                              const { type } = contentType;
                            
                              /**
                               * Tooltips are very similar. It's pretty much blocks
                            Severity: Major
                            Found in superset-frontend/src/components/MetadataBar/ContentConfig.tsx - About 2 hrs to fix

                              Function render has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                                render() {
                                  const { data, metric, groups } = this.props;
                                  const { control, liftValues, pValues } = this.state;
                              
                                  if (!Array.isArray(groups) || groups.length === 0) {

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

                                  def set_dash_metadata(
                                      dashboard: Dashboard,
                                      data: dict[Any, Any],
                                      old_to_new_slice_ids: dict[int, int] | None = None,
                                  ) -> None:
                              Severity: Minor
                              Found in superset/daos/dashboard.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 update_id_refs has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def update_id_refs(  # pylint: disable=too-many-locals
                                  config: dict[str, Any],
                                  chart_ids: dict[str, int],
                                  dataset_info: dict[str, dict[str, Any]],
                              ) -> dict[str, Any]:
                              Severity: Minor
                              Found in superset/commands/dashboard/importers/v1/utils.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 apply_post_process has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def apply_post_process(
                                  result: dict[Any, Any],
                                  form_data: Optional[dict[str, Any]] = None,
                                  datasource: Optional[Union["BaseDatasource", "Query"]] = None,
                              ) -> dict[Any, Any]:
                              Severity: Minor
                              Found in superset/charts/post_processing.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 DeckGLPolygon has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const DeckGLPolygon = (props: DeckGLPolygonProps) => {
                                const containerRef = useRef<DeckGLContainerHandle>();
                              
                                const getAdjustedViewport = useCallback(() => {
                                  let viewport = { ...props.viewport };

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

                              const DatasourcePanelItem: FC<Props> = ({ index, style, data }) => {
                                const {
                                  metricSlice: _metricSlice,
                                  columnSlice,
                                  totalMetrics,

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language