airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function traverse has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    treeNodes.map(treeNode => {
      const { name: nodeName, value, groupBy } = treeNode;
      const name = formatSeriesName(nodeName, {
        timeFormatter: getTimeFormatter(dateFormat),
        ...(coltypeMapping[groupBy] && {

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

    export const getLayer: getLayerType<unknown> = function (
      formData,
      payload,
      onAddFilter,
      setTooltip,

      Function buildQuery has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function buildQuery(formData: QueryFormData) {
        const baseFormData = {
          ...formData,
        };
      
      

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

            (seriesName, seriesIndex) => {
              const selected: string[] = Object.values(selectedValues || {});
              let values: string[];
              if (selected.includes(seriesName)) {
                values = selected.filter(v => v !== seriesName);

          Function mergeNativeFiltersToFormData has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const mergeNativeFiltersToFormData = (
            exploreFormData: QueryFormData,
            dashboardFormData: JsonObject,
          ) => {
            const nativeFiltersData: JsonObject = {};

            Function onSubjectChange has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const onSubjectChange = (id: string) => {
                const option = props.options.find(
                  option =>
                    ('column_name' in option && option.column_name === id) ||
                    ('optionName' in option && option.optionName === id),

              Function useSchemas has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function useSchemas(options: Params) {
                const { dbId, catalog, onSuccess, onError } = options || {};
                const [trigger] = useLazySchemasQuery();
                const result = useSchemasQuery(
                  { dbId, catalog: catalog || undefined, forceRefresh: false },
              Severity: Minor
              Found in superset-frontend/src/hooks/apiResources/schemas.ts - About 1 hr to fix

                Function handleOnSelect has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const handleOnSelect: SelectProps['onSelect'] = (selectedItem, option) => {
                      if (isSingleMode) {
                        // on select is fired in single value mode if the same value is selected
                        const valueChanged = !utilsIsEqual(
                          selectedItem,
                Severity: Minor
                Found in superset-frontend/src/components/Select/Select.tsx - About 1 hr to fix

                  Function ReorderableColumns has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const ReorderableColumns: StoryFn<typeof Table> = args => {
                    const [droppedItem, setDroppedItem] = useState<string | undefined>();
                    const dragOver = (ev: DragEvent<HTMLDivElement>) => {
                      ev.preventDefault();
                      const element: HTMLElement | null = ev?.currentTarget as HTMLElement;
                  Severity: Minor
                  Found in superset-frontend/src/components/Table/Table.stories.tsx - About 1 hr to fix

                    Function getTableMetadata has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const getTableMetadata = async (props: IColumnProps) => {
                        const { dbId, tableName, schema } = props;
                        setLoading(true);
                        setHasColumns?.(false);
                        const path = `/api/v1/database/${dbId}/table_metadata/${toQueryString({

                      Function related has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const related = Object.entries(filters).reduce((acc, [filterKey, filter]) => {
                          const isCrossFilter =
                            Object.keys(slices).includes(filterKey) &&
                            isAppliedCrossFilterType(filter);
                      
                      
                      Severity: Minor
                      Found in superset-frontend/src/dashboard/util/getRelatedCharts.ts - About 1 hr to fix

                        Function handleSelectChange has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            (newChartId: number) => {
                              if (isDefined(currentChartId)) {
                                const currentScope = !isCrossFilterScopeGlobal(
                                  chartConfigs[currentChartId]?.crossFilters.scope,
                                )

                          Function transformFilter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              const transformFilter = (id: string) => {
                                const formInputs = values.filters?.[id] || filterConfigMap[id];
                                if (!formInputs) {
                                  return undefined;
                                }

                            Function ExplorePage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function ExplorePage() {
                              const [isLoaded, setIsLoaded] = useState(false);
                              const isExploreInitialized = useRef(false);
                              const dispatch = useDispatch();
                              const location = useLocation();
                            Severity: Minor
                            Found in superset-frontend/src/pages/Chart/index.tsx - About 1 hr to fix

                              Function SQLPopover has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const SQLPopover = (props: PopoverProps & { sqlExpression: string }) => {
                                const theme = useTheme();
                                const [AceEditor, setAceEditor] = useState<typeof ReactAce | null>(null);
                                useEffect(() => {
                                  Promise.all([

                                Function updateDashboardLabelsColor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const updateDashboardLabelsColor = () => async (dispatch, getState) => {
                                  const {
                                    dashboardInfo: { id, metadata },
                                  } = getState();
                                  const categoricalSchemes = getCategoricalSchemeRegistry();
                                Severity: Minor
                                Found in superset-frontend/src/dashboard/actions/dashboardState.js - About 1 hr to fix

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

                                      (data, treePathInfo) => {
                                        if (data?.children) {
                                          return undefined;
                                        }
                                        const { treePath } = extractTreePathInfo(treePathInfo);

                                    Function optionsForSelect has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const optionsForSelect = (
                                        columns: ColumnMeta[],
                                        formData: QueryFormData | null | undefined,
                                      ) => {
                                        const options: OptionSortType[] = [

                                      Function checkForRefresh has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const checkForRefresh = () => {
                                          const shouldRequestChecking = shouldCheckForQueries(queries);
                                          if (!pendingRequestRef.current && shouldRequestChecking) {
                                            const params = rison.encode({
                                              last_updated_ms: queriesLastUpdate - QUERY_UPDATE_BUFFER_MS,
                                      Severity: Minor
                                      Found in superset-frontend/src/SqlLab/components/QueryAutoRefresh/index.tsx - About 1 hr to fix

                                        Function handleSaveInDataset has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          const handleSaveInDataset = () => {
                                            setLoading(true);
                                            const selectedColumns = datasource?.columns ?? [];
                                        
                                            // The filters param is only used to test jinja templates.
                                        Severity: Minor
                                        Found in superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language