airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Consider simplifying this complex logical expression.
Open

    if (sourceType !== ANNOTATION_SOURCE_TYPES.NATIVE && slice) {
      const columns = (slice.data.groupby || [])
        .concat(slice.data.all_columns || [])
        .map(x => ({ value: x, label: x }));
      const timeColumnOptions = slice.data.include_time

    Consider simplifying this complex logical expression.
    Open

                if (
                  !hasWarned &&
                  (isChildParentTagged ||
                    (isChildParentArrow && isParentTemplateLiteral)) &&
                  rawValue &&
    Severity: Critical
    Found in superset-frontend/tools/eslint-plugin-theme-colors/index.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

              if imt(token, m=[(Keyword, "FROM"), (Keyword, "JOIN")]):
                  state = InsertRLSState.SEEN_SOURCE
      
              # Found identifier/keyword after FROM/JOIN, test for table
              elif state == InsertRLSState.SEEN_SOURCE and (
      Severity: Critical
      Found in superset/sql_parse.py - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

          if (
            controlState.columns &&
            (isAdhocMetricSimple(value) || isSimpleAdhocFilter(value)) &&
            ((!isEmpty(controlState.columns) &&
              controlState.columns.some(

          Consider simplifying this complex logical expression.
          Open

            if (
              cachedFiltersByChart[sliceId] === filters &&
              areObjectsEqual(cachedFormData?.color_scheme, colorScheme, {
                ignoreUndefined: true,
              }) &&

            Consider simplifying this complex logical expression.
            Open

                if (
                  !importLoading &&
                  !alreadyExists.length &&
                  !passwordsNeeded.length &&
                  !sshPasswordNeeded.length &&
            Severity: Critical
            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 hr to fix

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

                const getCrossFilterDataMask = source => {
                  const selected = Object.values(filterState.selectedValues || {});
                  const key = source.id || source.country;
                  const country =
                    countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.country;

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

                export default function transformProps(chartProps) {
                  const { width, height, datasource, formData, queriesData } = chartProps;
                  const {
                    colorScheme,
                    dateTimeFormat,

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

                    renderFilterScopeTree() {
                      const {
                        filterScopeMap,
                        activeFilterField,
                        checkedFilterFields,

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

                        .map((datum: any) => {
                          const groupbyLabel = extractGroupbyLabel({
                            datum,
                            groupby: groupbyLabels,
                            coltypeMapping,

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

                                    mapStateToProps(explore, _, chart) {
                                      const verboseMap = explore?.datasource?.hasOwnProperty(
                                        'verbose_map',
                                      )
                                        ? (explore?.datasource as Dataset)?.verbose_map
                      Severity: Minor
                      Found in superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx - About 1 hr to fix

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

                          function createTree(rootNodeId: DataRecordValue): TreeSeriesNodeItemOption {
                            const rootNodeName = findNodeName(rootNodeId);
                            const tree: TreeSeriesNodeItemOption = { name: rootNodeName, children: [] };
                            const children: TreeSeriesNodeItemOption[][] = [];
                            const indexMap: { [name: string]: number } = {};

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

                                  formatter: (param: CallbackDataParams) => {
                                    // @ts-ignore
                                    const {
                                      value,
                                      name,

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

                              const getCrossFilterDataMask = (node: DataRow | undefined) => {
                                if (!node?.name || !node?.col) {
                                  return undefined;
                                }
                                const { name, col } = node;

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

                              window.addEventListener('message', function embeddedPageInitializer(event) {
                                try {
                                  validateMessageEvent(event);
                                } catch (err) {
                                  log('ignoring message unrelated to embedded comms', err, event);
                              Severity: Minor
                              Found in superset-frontend/src/embedded/index.tsx - About 1 hr to fix

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

                                    (resourceID: number) => {
                                      // Set loading state
                                      updateState({
                                        loading: true,
                                      });
                                Severity: Minor
                                Found in superset-frontend/src/views/CRUD/hooks.ts - About 1 hr to fix

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

                                  export const simpleFilterToAdhoc = (
                                    filterClause: QueryObjectFilterClause,
                                    clause: Clauses = Clauses.Where,
                                  ) => {
                                    let result: AdhocFilter;
                                  Severity: Minor
                                  Found in superset-frontend/src/utils/simpleFilterToAdhoc.ts - About 1 hr to fix

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

                                    export default function downloadAsImage(
                                      selector: string,
                                      description: string,
                                      isExactSelector = false,
                                    ) {
                                    Severity: Minor
                                    Found in superset-frontend/src/utils/downloadAsImage.ts - About 1 hr to fix

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

                                          (breadcrumb: DrillByBreadcrumb, index: number) => {
                                            dispatch(
                                              logEvent(LOG_ACTIONS_DRILL_BY_BREADCRUMB_CLICKED, {
                                                slice_id: formData.slice_id,
                                              }),
                                      Severity: Minor
                                      Found in superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx - About 1 hr to fix

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

                                        export function saveFilterBarOrientation(orientation: FilterBarOrientation) {
                                          return async (dispatch: Dispatch, getState: () => RootState) => {
                                            const { id, metadata } = getState().dashboardInfo;
                                            const updateDashboard = makeApi<
                                              Partial<DashboardInfo>,
                                        Severity: Minor
                                        Found in superset-frontend/src/dashboard/actions/dashboardInfo.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language