airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function CrossFilterTag has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CrossFilterTag = (props: {
  filter: CrossFilterIndicator;
  orientation: FilterBarOrientation;
  removeCrossFilter: (filterId: number) => void;
}) => {

    Function loadDatasources has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      loadDatasources(search: string, page: number, pageSize: number) {
        const query = rison.encode({
          columns: [
            'id',
            'table_name',
    Severity: Minor
    Found in superset-frontend/src/pages/ChartCreation/index.tsx - About 1 hr to fix

      Function handleSave has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const handleSave = async () => {
          const values: NativeFiltersForm | null = await validateForm(
            form,
            currentFilterId,
            setCurrentFilterId,

        Function expandControlConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function expandControlConfig(
          control: ControlSetItem,
          controlOverrides: ControlOverrides = {},
        ): ExpandedControlItem {
          // one of the named shared controls

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

            render() {
              const { didVerify, error, payload } = this.state;
              const { children } = this.props;
          
              return didVerify ? (

            Function createDatasource has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function createDatasource(vizOptions) {
              return dispatch => {
                dispatch(createDatasourceStarted());
                const { dbId, catalog, schema, datasourceName, sql } = vizOptions;
                return SupersetClient.post({
            Severity: Minor
            Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 1 hr to fix

              Function actions.START_QUERY has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  [actions.START_QUERY]() {
                    let newState = { ...state };
                    if (action.query.sqlEditorId) {
                      const qe = {
                        ...getFromArr(state.queryEditors, action.query.sqlEditorId),
              Severity: Minor
              Found in superset-frontend/src/SqlLab/reducers/sqlLab.js - About 1 hr to fix

                Function validate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  validate(callback) {
                    let errors = [];
                    let dups;
                    const { datasource } = this.state;
                
                
                Severity: Minor
                Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 1 hr to fix

                  Function syncTable has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function syncTable(table, tableMetadata) {
                    return function (dispatch) {
                      const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
                        ? SupersetClient.post({
                            endpoint: encodeURI('/tableschemaview/'),
                  Severity: Minor
                  Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 1 hr to fix

                    Function formatter has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          formatter: (params: CallbackDataParams) => {
                            const totals = calculateTotals(
                              data,
                              xAxisLabel,
                              yAxisLabel,

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

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

                        Function dataTabTitle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const dataTabTitle = useMemo(() => {
                            if (!props.errorMessage) {
                              dataTabHasHadNoErrors.current = true;
                            }
                        
                        
                        Severity: Minor
                        Found in superset-frontend/src/explore/components/ControlPanelsContainer.tsx - About 1 hr to fix

                          Function CollapseButton has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const CollapseButton = useMemo(() => {
                              const caretIcon = panelOpen ? (
                                <Icons.CaretUp
                                  iconColor={theme.colors.grayscale.base}
                                  aria-label={t('Collapse data panel')}

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

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

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

                              export default function buildQuery(formData: QueryFormData) {
                                const { groupby } = formData;
                                const [column = ''] = groupby || [];
                                // @ts-ignore (need update interface Column )
                                return buildQueryContext(formData, baseQueryObject => [
                              Severity: Minor
                              Found in superset-frontend/src/filters/components/Range/buildQuery.ts - About 1 hr to fix

                                Function vizTiles has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    const vizTiles = useMemo(() => {
                                      const vizTiles = [...FEATURED_CHARTS];
                                      if (
                                        currentSelection &&
                                        FEATURED_CHARTS.every(

                                  Function sortColumn has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    sortColumn(col: string, sort = SortOrder.Unsorted) {
                                      const { sortColumns } = this.props;
                                      // default sort logic sorting string, boolean and number
                                      const compareSort = (m: Sort, n: Sort) => {
                                        if (typeof m === 'string') {
                                  Severity: Minor
                                  Found in superset-frontend/src/components/Datasource/CollectionTable.tsx - About 1 hr to fix

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

                                      const onSave = async () => {
                                        await SupersetClient.post({
                                          endpoint: `/api/v1/tag/bulk_create`,
                                          jsonPayload: {
                                            tags: tags.map(tag => ({
                                    Severity: Minor
                                    Found in superset-frontend/src/features/tags/BulkTagModal.tsx - About 1 hr to fix

                                      Function setupColors has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export default function setupColors(
                                        extraCategoricalColorSchemeConfigs: ColorSchemeConfig[] = [],
                                        extraSequentialColorSchemeConfigs: SequentialSchemeConfig[] = [],
                                      ) {
                                        const extraCategoricalColorSchemes = extraCategoricalColorSchemeConfigs.map(
                                      Severity: Minor
                                      Found in superset-frontend/src/setup/setupColors.ts - About 1 hr to fix

                                        Function handleKeyDown has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
                                            switch (event.key) {
                                              case 'Escape':
                                              case 'Enter':
                                                // timing out to allow for filter selection to happen first
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language