airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

  render() {
    const {
      className,
      debounceTime,
      width,

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

      constructor(adhocFilter) {
        this.expressionType = adhocFilter.expressionType || ExpressionTypes.Simple;
        if (this.expressionType === ExpressionTypes.Simple) {
          this.subject = adhocFilter.subject;
          this.operator = adhocFilter.operator?.toUpperCase();

      Function CREATE_TOP_LEVEL_TABS has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        [CREATE_TOP_LEVEL_TABS](state, action) {
          const {
            payload: { dropResult },
          } = action;
          const { source, dragging } = dropResult;
      Severity: Minor
      Found in superset-frontend/src/dashboard/reducers/dashboardLayout.js - About 1 hr to fix

        Function treeBuilder has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function treeBuilder(
          data: DataRecord[],
          groupBy: string[],
          metric: string,
          secondaryMetric?: string,

          Function useInstance has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function useInstance<D extends object>(instance: TableInstance<D>) {
            const {
              dispatch,
              state: { sticky },
              data,

            Function getLayer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function getLayer(
              formData: PolygonFormData,
              payload: JsonObject,
              onAddFilter: HandlerFunction,
              setTooltip: (tooltip: TooltipProps['tooltip']) => void,

              Function renderHeader has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderHeader(maxHeight: number) {
                  const { bigNumber, headerFormatter, width, colorThresholdFormatters } =
                    this.props;
                  // @ts-ignore
                  const text = bigNumber === null ? t('No data') : headerFormatter(bigNumber);

                Function transformProps has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function transformProps(
                  chartProps: PluginFilterSelectChartProps,
                ) {
                  const {
                    formData,
                Severity: Minor
                Found in superset-frontend/src/filters/components/Select/transformProps.ts - About 1 hr to fix

                  Function useAnnotations has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function useAnnotations(params: FetchValidationQueryParams) {
                    const { sql, dbId, schema, templateParams } = params;
                    const debouncedSql = useDebounceValue(sql, VALIDATION_DEBOUNCE_MS);
                    const hasValidator = useSelector<SqlLabRootState>(({ sqlLab, common }) =>
                      // Check whether or not we can validate the current query based on whether

                    Function AsyncEsmComponent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function AsyncEsmComponent<
                      P = PlaceholderProps,
                      M = ComponentType<P> | { default: ComponentType<P> },
                    >(
                      /**
                    Severity: Minor
                    Found in superset-frontend/src/components/AsyncEsmComponent/index.tsx - About 1 hr to fix

                      Function DownloadMenuItems has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DownloadMenuItems = (props: DownloadMenuItemProps) => {
                        const {
                          pdfMenuItemTitle,
                          imageMenuItemTitle,
                          logEvent,

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

                          constructor(config: ChartMetadataConfig) {
                            const {
                              name,
                              canBeAnnotationTypes = [],
                              credits = [],

                          Function renameOperator has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const renameOperator: PostProcessingFactory<PostProcessingRename> = (
                            formData,
                            queryObject,
                          ) => {
                            const metrics = ensureIsArray(queryObject.metrics);

                            Function upgrade has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def upgrade():
                                bind = op.get_bind()
                                session = db.Session(bind=bind)
                            
                                tables = [

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

                                def copy_dashboard(
                                    cls, original_dash: Dashboard, data: dict[str, Any]
                                ) -> Dashboard:
                                    if is_feature_enabled("DASHBOARD_RBAC") and not security_manager.is_owner(
                                        original_dash
                            Severity: Minor
                            Found in superset/daos/dashboard.py - About 1 hr 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 _pre_action has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _pre_action(self) -> None:
                                    self.data["contributionMode"] = "row" if self.data.get("contribution") else None
                                    self.data["zoomable"] = self.data.get("show_brush") == "yes"
                                    self.data["markerEnabled"] = self.data.get("show_markers") or False
                                    self.data["y_axis_showminmax"] = True
                            Severity: Minor
                            Found in superset/migrations/shared/migrate_viz/processors.py - About 1 hr 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 scan_dashboard_positions_data has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def scan_dashboard_positions_data(positions):
                                positions_by_row_id = {}
                                for position in positions:
                                    row = position["row"]
                                    position["col"] = min(position["col"], TOTAL_COLUMNS)

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

                                def adhoc_column_to_sqla(  # pylint: disable=too-many-locals
                                    self,
                                    col: AdhocColumn,
                                    force_type_check: bool = False,
                                    template_processor: BaseTemplateProcessor | None = None,
                            Severity: Minor
                            Found in superset/connectors/sqla/models.py - About 1 hr 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 prophet has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def prophet(  # pylint: disable=too-many-arguments
                                df: DataFrame,
                                time_grain: str,
                                periods: int,
                                confidence_interval: float,
                            Severity: Minor
                            Found in superset/utils/pandas_postprocessing/prophet.py - About 1 hr 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 port_translation_func has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def port_translation_func(req: AdvancedDataTypeRequest) -> AdvancedDataTypeResponse:
                                """
                                Convert a passed in AdvancedDataTypeRequest to a AdvancedDataTypeResponse
                                """
                                resp: AdvancedDataTypeResponse = {
                            Severity: Minor
                            Found in superset/advanced_data_type/plugins/internet_port.py - About 1 hr 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