airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File sections.tsx has 251 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
Severity: Minor
Found in superset-frontend/src/explore/controlPanels/sections.tsx - About 2 hrs to fix

    File Pie.stories.tsx has 251 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 extremes has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        extremes(mode, formatter = usFmt) {
          return function ([attr]) {
            return function (data) {
              return {
                val: null,

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

          render() {
            const { className, width, height, position, renderChart, renderLegend } =
              this.props;
        
            const isHorizontal = position === 'left' || position === 'right';

          Consider simplifying this complex logical expression.
          Open

                  if (annotationData) {
                    // Event annotations
                    activeAnnotationLayers
                      .filter(
                        x =>
          Severity: Critical
          Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js - About 2 hrs to fix

            Function isControlValueCompatibleWithDatasource has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const isControlValueCompatibleWithDatasource = (
              datasource: Dataset,
              controlState: ControlState,
              value: any,
            ) => {

              Function renderWell has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const renderWell = () => {
                  let partitions;
                  let metadata;
                  if (tableData.partitions) {
                    let partitionQuery;
              Severity: Minor
              Found in superset-frontend/src/SqlLab/components/TableElement/index.tsx - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                      if (sqlLab.queryEditors.length === 0) {
                        // migration was successful
                        localStorage.removeItem('redux');
                      } else {
                        unsavedQueryEditor = sqlLab.unsavedQueryEditor || unsavedQueryEditor;
                Severity: Critical
                Found in superset-frontend/src/SqlLab/reducers/getInitialState.ts - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (search || visualize || csv) {
                        let { data } = query.results;
                        if (cache && query.cached) {
                          data = cachedData;
                        }
                  Severity: Critical
                  Found in superset-frontend/src/SqlLab/components/ResultSet/index.tsx - About 2 hrs to fix

                    Function useChildElementTruncation has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const useChildElementTruncation = () => {
                      const [elementsTruncated, setElementsTruncated] = useState(0);
                      const [hasHiddenElements, setHasHiddenElements] = useState(false);
                      const elementRef = useRef<HTMLDivElement>(null);
                      const plusRef = useRef<HTMLDivElement>(null);

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

                        runningStat(mode = 'mean', ddof = 1, formatter = usFmt) {
                          return function ([attr]) {
                            return function () {
                              return {
                                n: 0.0,

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

                          syncMetadata() {
                            const { datasource } = this.state;
                            const params = {
                              datasource_type: datasource.type || datasource.datasource_type,
                              database_name:
                        Severity: Minor
                        Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 1 hr to fix

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

                          export function syncQueryEditor(queryEditor) {
                            return function (dispatch, getState) {
                              const { tables, queries } = getState().sqlLab;
                              const localStorageTables = tables.filter(
                                table => table.inLocalStorage && table.queryEditorId === queryEditor.id,
                          Severity: Minor
                          Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 1 hr to fix

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

                              renderList() {
                                if (this.props.value.length === 0) {
                                  return <div className="text-muted">{this.props.placeholder}</div>;
                                }
                                const Control = controlMap[this.props.controlName];

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

                                render() {
                                  const {
                                    children,
                                    className,
                                    orientation,
                              Severity: Minor
                              Found in superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx - About 1 hr to fix

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

                                    (
                                      e: MouseEvent,
                                      colKey: (string | number | boolean)[] | undefined,
                                      rowKey: (string | number | boolean)[] | undefined,
                                      dataPoint: { [key: string]: string },

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

                                  const initialize = (withValidator = false) => {
                                    if (withValidator) {
                                      return renderHook(
                                        () =>
                                          useAnnotations({

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

                                            func: (editor: AceEditor['editor']) => {
                                              if (!editor.getValue().trim()) {
                                                return;
                                              }
                                              const session = editor.getSession();
                                    Severity: Minor
                                    Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 1 hr to fix

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

                                        const loadFileMetadata = (file: File) => {
                                          const fields = form.getFieldsValue();
                                          const mergedValues = { ...defaultUploadInfo, ...fields };
                                          const formData = new FormData();
                                          formData.append('file', file);
                                      Severity: Minor
                                      Found in superset-frontend/src/features/databases/UploadDataModel/index.tsx - About 1 hr to fix

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

                                        export const PathChartViz = () => {
                                          const theme = useTheme();
                                          return (
                                            <SuperChart
                                              chartType="deck_path"
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language