airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function renderEditor has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderEditor(inModal = false) {
    const minLines = inModal ? 40 : this.props.minLines || 12;
    if (this.props.language) {
      const style = {
        border: `1px solid ${this.props.theme.colors.grayscale.light1}`,

    Function prompting has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async prompting() {
        this.option('skipInstall');
    
        this.answers = await this.prompt([
          {

      Function import_dashboard has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def import_dashboard(
          # pylint: disable=too-many-locals,too-many-statements
          dashboard_to_import: Dashboard,
          dataset_id_mapping: Optional[dict[int, int]] = None,
          import_time: Optional[int] = None,
      Severity: Minor
      Found in superset/commands/dashboard/importers/v0.py - About 1 hr to fix

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

          render() {
            const { scaleFactor } = this.state;
            const { width, height, encoding, sliceId, colorScheme } = this.props;
            const { words } = this.state;
        
        

          Function contextmenu has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              contextmenu: async eventParams => {
                if (onContextMenu) {
                  eventParams.event.stop();
                  const { data, treePathInfo } = eventParams;
                  const { records } = data;

            Function commonLayerProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function commonLayerProps(
              formData: QueryFormData,
              setTooltip: (tooltip: TooltipProps['tooltip']) => void,
              setTooltipContent: (content: JsonObject) => ReactNode,
              onSelect?: (value: JsonValue) => void,

              Function mapOption has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  (option: OptionValueType) => {
                    // already a AdhocFilter, skip
                    if (option instanceof AdhocFilter) {
                      return option;
                    }

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

                  const onSave = () => {
                    const dashboards = dashboardsToTag.map(dash => ['dashboard', dash.value]);
                    const charts = chartsToTag.map(chart => ['chart', chart.value]);
                    const savedQueries = savedQueriesToTag.map(q => ['query', q.value]);
                
                
                Severity: Minor
                Found in superset-frontend/src/features/tags/TagModal.tsx - About 1 hr to fix

                  Function datasetReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function datasetReducer(
                    state: DatasetObject | null,
                    action: DSReducerActionType,
                  ): Partial<DatasetObject> | Schema | null {
                    const trimmedState = {
                  Severity: Minor
                  Found in superset-frontend/src/pages/DatasetCreation/index.tsx - About 1 hr to fix

                    Function getRowsWithoutRoles has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const getRowsWithoutRoles = () => {
                        const jsonMetadataObj = getJsonMetadata();
                        const hasCustomLabelsColor = !!Object.keys(
                          jsonMetadataObj?.label_colors || {},
                        ).length;

                      Function computeEndTimeFromGranularity has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function computeEndTimeFromGranularity(
                        time: Date,
                        granularity: TimeGranularity,
                        useLocalTime: boolean,
                      ) {

                        Function computeCustomDateTime has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const computeCustomDateTime = (
                          dttm: string,
                          grain: string,
                          grainValue: number,
                        ) => {

                          Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(  # pylint: disable=too-many-arguments
                          Severity: Major
                          Found in superset/models/helpers.py - About 1 hr to fix

                            Function raise_for_access has 12 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def raise_for_access(
                            Severity: Major
                            Found in superset/security/manager.py - About 1 hr to fix

                              Function actions.REMOVE_QUERY_EDITOR has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  [actions.REMOVE_QUERY_EDITOR]() {
                                    const queryEditor = {
                                      ...action.queryEditor,
                                      ...(action.queryEditor.id === state.unsavedQueryEditor.id &&
                                        state.unsavedQueryEditor),
                              Severity: Minor
                              Found in superset-frontend/src/SqlLab/reducers/sqlLab.js - About 1 hr to fix

                                Function UNSAFE_componentWillReceiveProps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  UNSAFE_componentWillReceiveProps(nextProps) {
                                    const maxIndex = Math.max(0, nextProps.component.children.length - 1);
                                    const currTabsIds = this.props.component.children;
                                    const nextTabsIds = nextProps.component.children;
                                
                                
                                Severity: Minor
                                Found in superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx - About 1 hr to fix

                                  Function constructor has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    constructor() {
                                      super({
                                        buildQuery,
                                        controlPanel,
                                        loadChart: () => import('./EchartsMixedTimeseries'),

                                    Function constructor has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      constructor() {
                                        super({
                                          buildQuery,
                                          controlPanel,
                                          loadChart: () => import('../EchartsTimeseries'),

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

                                          (treePathInfo: TreePathInfo[]) => {
                                            const treePath = extractTreePathInfo(treePathInfo);
                                            const name = treePath.join(',');
                                            const selected = Object.values(selectedValues);
                                            let values: string[];

                                        Function useOverflowDetection has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const useOverflowDetection = (flexGap: number) => {
                                          const symbolContainerRef = useRef<HTMLDivElement>(null);
                                          const wrapperRef = useRef<HTMLDivElement>(null);
                                          const [isOverflowing, setIsOverflowing] = useState(false);
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language