airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

  render() {
    const { isPublished, userCanEdit, userCanSave } = this.props;

    // Show everybody the draft badge
    if (!isPublished) {

    Function shouldComponentUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      shouldComponentUpdate(nextProps, nextState) {
        // this logic mostly pertains to chart resizing. we keep a copy of the dimensions in
        // state so that we can buffer component size updates and only update on the final call
        // which improves performance significantly
        if (
    Severity: Minor
    Found in superset-frontend/src/dashboard/components/gridComponents/Chart.jsx - About 1 hr to fix

      Function filterTree has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        filterTree() {
          // Reset nodes back to unfiltered state
          if (!this.state.searchText) {
            this.setState(prevState => {
              const { activeFilterField, checkedFilterFields, filterScopeMap } =

        Function DeckGLScreenGrid has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DeckGLScreenGrid = (props: DeckGLScreenGridProps) => {
          const containerRef = useRef<DeckGLContainerHandle>();
        
          const getAdjustedViewport = useCallback(() => {
            const features = props.payload.data.features || [];

          Function AdvancedFrame has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function AdvancedFrame(props: FrameComponentProps) {
            const advancedRange = getAdvancedRange(props.value || '');
            const [since, until] = advancedRange.split(SEPARATOR);
            if (advancedRange !== props.value) {
              props.onChange(getAdvancedRange(props.value || ''));

            Function useFavoriteStatus has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function useFavoriteStatus(
              type: 'chart' | 'dashboard' | 'tag',
              ids: Array<string | number>,
              handleErrorMsg: (message: string) => void,
            ) {
            Severity: Minor
            Found in superset-frontend/src/views/CRUD/hooks.ts - About 1 hr to fix

              Function queryPane has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const queryPane = () => {
                  const { aceEditorHeight, southPaneHeight } =
                    getAceEditorAndSouthPaneHeights(height, northPercent, southPercent);
                  return (
                    <Split
              Severity: Minor
              Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 1 hr to fix

                Function loadDatabases has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      async (
                        search: string,
                        page: number,
                        pageSize: number,
                      ): Promise<{
                Severity: Minor
                Found in superset-frontend/src/components/DatabaseSelector/index.tsx - About 1 hr to fix

                  Function getRelatedCharts has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function getRelatedCharts(
                    filters: Record<
                      string,
                      AppliedNativeFilterType | AppliedCrossFilterType | Filter
                    >,
                  Severity: Minor
                  Found in superset-frontend/src/dashboard/util/getRelatedCharts.ts - About 1 hr to fix

                    Function reactify has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function reactify<Props extends object>(
                      renderFn: RenderFuncType<Props>,
                      callbacks?: LifeCycleCallbacks,
                    ): ComponentClass<Props & ReactifyProps> {
                      class ReactifiedComponent extends Component<Props & ReactifyProps> {

                      Function drawBarValues has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function drawBarValues(svg, data, stacked, axisFormat) {
                        const format = getNumberFormatter(axisFormat);
                        const countSeriesDisplayed = data.filter(d => !d.disabled).length;
                        const totalStackedValues =
                          stacked && data.length !== 0
                      Severity: Minor
                      Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/utils.js - About 1 hr to fix

                        Function SankeyLoop has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function SankeyLoop(element, props) {
                          const { data, width, height, colorScheme, sliceId } = props;
                          const color = CategoricalColorNamespace.getScale(colorScheme);
                          const margin = { ...defaultMargin, ...props.margin };
                          const innerWidth = width - margin.left - margin.right;

                          Function runQuery has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function runQuery(query) {
                            return function (dispatch) {
                              dispatch(startQuery(query));
                              const postPayload = {
                                client_id: query.id,
                          Severity: Minor
                          Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 1 hr to fix

                            Function ViewQueryModal has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const ViewQueryModal: FC<Props> = props => {
                              const [result, setResult] = useState<Result[]>([]);
                              const [isLoading, setIsLoading] = useState(false);
                              const [error, setError] = useState<string | null>(null);
                            
                            

                              Function Component has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const Component = (props: DropdownContainerProps) => {
                                const [items, setItems] = useState<ItemsType>([]);
                                const [overflowingState, setOverflowingState] = useState<OverflowingState>();
                                const containerRef = useRef<Ref>(null);
                                const onOverflowingStateChange = useCallback(

                                Function handleDashboardEdit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function handleDashboardEdit(edits: Dashboard) {
                                    return SupersetClient.get({
                                      endpoint: `/api/v1/dashboard/${edits.id}`,
                                    }).then(
                                      ({ json = {} }) => {
                                Severity: Minor
                                Found in superset-frontend/src/pages/DashboardList/index.tsx - About 1 hr to fix

                                  Function finestTemporalGrain has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function finestTemporalGrain(
                                    values: any[],
                                    useLocalTime = false,
                                  ) {
                                    const format = useLocalTime ? timeFormat : utcFormat;

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

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

                                      Function create has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            create(context) {
                                              const warned = [];
                                              return {
                                                TemplateElement(node) {
                                                  const rawValue = node?.value?.raw;
                                      Severity: Minor
                                      Found in superset-frontend/tools/eslint-plugin-theme-colors/index.js - About 1 hr to fix

                                        Function MOVE_COMPONENT has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

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