airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function mapStateToProps has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mapStateToProps(state) {
  const {
    explore,
    charts,
    common,

    Function renderGroupingHeaders has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderGroupingHeaders = (): JSX.Element => {
        // TODO: Make use of ColumnGroup to render the aditional headers
        const headers: any = [];
        let currentColumnIndex = 0;
    
    
    Severity: Major
    Found in superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx - About 2 hrs to fix

      File controlPanel.tsx has 270 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 DeckGLContainer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          forwardRef((props: DeckGLContainerProps, ref) => {
            const [tooltip, setTooltip] = useState<TooltipProps['tooltip']>(null);
            const [lastUpdate, setLastUpdate] = useState<number | null>(null);
            const [viewState, setViewState] = useState(props.viewport);
            const prevViewport = usePrevious(props.viewport);

          File controlPanel.tsx has 269 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 renderRowHeaderRow has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              renderRowHeaderRow(pivotSettings) {
                // Render just the attribute names of the rows (the actual attribute values
                // will show up in the individual rows).
            
                const {

              Function loggerMiddleware has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const loggerMiddleware = store => next => action => {
                if (action.type !== LOG_EVENT) {
                  return next(action);
                }
              
              
              Severity: Major
              Found in superset-frontend/src/middleware/loggerMiddleware.js - About 2 hrs to fix

                Function attrValueCells has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const attrValueCells = rowKey.map((r, i) => {
                      let handleContextMenu;
                      let valueCellClassName = 'pvtRowLabel';
                      if (!omittedHighlightHeaderGroups.includes(rowAttrs[i])) {
                        if (highlightHeaderCellsOnHover) {

                  Function getCrossFilterDataMask has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const getCrossFilterDataMask = (key: string, value: DataRecordValue) => {
                      let updatedFilters = { ...(filters || {}) };
                      if (filters && isActiveFilterValue(key, value)) {
                        updatedFilters = {};
                      } else {
                  Severity: Major
                  Found in superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx - About 2 hrs to fix

                    Function sortedRows has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const sortedRows = rows.map((row, idx) => {
                        let sortKey: DataRecordValue = '';
                        let aggregate: number | undefined;
                        let entries = 0;
                        Object.entries(row).forEach(([key, value]) => {
                    Severity: Major
                    Found in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts - About 2 hrs to fix

                      Function contextmenu has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          contextmenu: async eventParams => {
                            if (onContextMenu) {
                              eventParams.event.stop();
                              const { data, seriesName, seriesIndex } = eventParams;
                              const pointerEvent = eventParams.event.event;

                        Function fetchSlices has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function fetchSlices(
                          userId?: number,
                          filter_value?: string,
                          sortColumn = 'changed_on',
                        ) {
                        Severity: Major
                        Found in superset-frontend/src/dashboard/actions/sliceEntities.ts - About 2 hrs to fix

                          Function selectNativeIndicatorsForChart has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const selectNativeIndicatorsForChart = (
                            nativeFilters: Filters,
                            dataMask: DataMaskStateWithId,
                            chartId: number,
                            chart: any,
                          Severity: Major
                          Found in superset-frontend/src/dashboard/components/nativeFilters/selectors.ts - About 2 hrs to fix

                            Function setupFormatters has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function setupFormatters(
                              d3NumberFormat: Partial<FormatLocaleDefinition>,
                              d3TimeFormat: Partial<TimeLocaleDefinition>,
                            ) {
                              getNumberFormatterRegistry()
                            Severity: Major
                            Found in superset-frontend/src/setup/setupFormatters.ts - About 2 hrs to fix

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

                                render() {
                                  const {
                                    showChangeDatasourceModal,
                                    showEditDatasourceModal,
                                    showSaveDatasetModal,

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

                                shouldComponentUpdate(nextProps, nextState) {
                                  // this logic mostly pertains to chart resizing. we keep a copy of the dimensions in
                                  // state so that we can buffer component size updates and only update on the final call
                                  // which improves performance significantly
                                  if (
                              Severity: Minor
                              Found in superset-frontend/src/dashboard/components/gridComponents/Chart.jsx - 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 upgrade has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def upgrade():
                                  bind = op.get_bind()
                                  session = db.Session(bind=bind)
                                  for dashboard in paginated_update(session.query(Dashboard)):
                                      #

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

                              def convert_filter_scopes(
                                  json_metadata: dict[Any, Any], filter_boxes: list[Slice]
                              ) -> dict[int, dict[str, dict[str, Any]]]:
                                  filter_scopes = {}
                                  immuned_by_id: list[int] = json_metadata.get("filter_immune_slices") or []
                              Severity: Minor
                              Found in superset/utils/dashboard_filter_scopes_converter.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 validate_statement has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def validate_statement(
                                      cls,
                                      statement: str,
                                      database: Database,
                                      cursor: Any,
                              Severity: Minor
                              Found in superset/sql_validators/presto_db.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_top_to_sql has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def apply_top_to_sql(cls, sql: str, limit: int) -> str:
                                      """
                                      Alters the SQL statement to apply a TOP clause
                                      :param limit: Maximum number of rows to be returned by the query
                                      :param sql: SQL query
                              Severity: Minor
                              Found in superset/db_engine_specs/base.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

                              Severity
                              Category
                              Status
                              Source
                              Language