Showing 2,441 of 6,157 total issues
Function traverse
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
treeNodes.map(treeNode => {
const { name: nodeName, value, groupBy } = treeNode;
const name = formatSeriesName(nodeName, {
timeFormatter: getTimeFormatter(dateFormat),
...(coltypeMapping[groupBy] && {
Function getLayer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getLayer: getLayerType<unknown> = function (
formData,
payload,
onAddFilter,
setTooltip,
Function buildQuery
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function buildQuery(formData: QueryFormData) {
const baseFormData = {
...formData,
};
Function getCrossFilterDataMask
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(seriesName, seriesIndex) => {
const selected: string[] = Object.values(selectedValues || {});
let values: string[];
if (selected.includes(seriesName)) {
values = selected.filter(v => v !== seriesName);
Function mergeNativeFiltersToFormData
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const mergeNativeFiltersToFormData = (
exploreFormData: QueryFormData,
dashboardFormData: JsonObject,
) => {
const nativeFiltersData: JsonObject = {};
Function onSubjectChange
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const onSubjectChange = (id: string) => {
const option = props.options.find(
option =>
('column_name' in option && option.column_name === id) ||
('optionName' in option && option.optionName === id),
Function useSchemas
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useSchemas(options: Params) {
const { dbId, catalog, onSuccess, onError } = options || {};
const [trigger] = useLazySchemasQuery();
const result = useSchemasQuery(
{ dbId, catalog: catalog || undefined, forceRefresh: false },
Function handleOnSelect
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleOnSelect: SelectProps['onSelect'] = (selectedItem, option) => {
if (isSingleMode) {
// on select is fired in single value mode if the same value is selected
const valueChanged = !utilsIsEqual(
selectedItem,
Function ReorderableColumns
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ReorderableColumns: StoryFn<typeof Table> = args => {
const [droppedItem, setDroppedItem] = useState<string | undefined>();
const dragOver = (ev: DragEvent<HTMLDivElement>) => {
ev.preventDefault();
const element: HTMLElement | null = ev?.currentTarget as HTMLElement;
Function getTableMetadata
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getTableMetadata = async (props: IColumnProps) => {
const { dbId, tableName, schema } = props;
setLoading(true);
setHasColumns?.(false);
const path = `/api/v1/database/${dbId}/table_metadata/${toQueryString({
Function related
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const related = Object.entries(filters).reduce((acc, [filterKey, filter]) => {
const isCrossFilter =
Object.keys(slices).includes(filterKey) &&
isAppliedCrossFilterType(filter);
Function handleSelectChange
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(newChartId: number) => {
if (isDefined(currentChartId)) {
const currentScope = !isCrossFilterScopeGlobal(
chartConfigs[currentChartId]?.crossFilters.scope,
)
Function transformFilter
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const transformFilter = (id: string) => {
const formInputs = values.filters?.[id] || filterConfigMap[id];
if (!formInputs) {
return undefined;
}
Function ExplorePage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ExplorePage() {
const [isLoaded, setIsLoaded] = useState(false);
const isExploreInitialized = useRef(false);
const dispatch = useDispatch();
const location = useLocation();
Function SQLPopover
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SQLPopover = (props: PopoverProps & { sqlExpression: string }) => {
const theme = useTheme();
const [AceEditor, setAceEditor] = useState<typeof ReactAce | null>(null);
useEffect(() => {
Promise.all([
Function updateDashboardLabelsColor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const updateDashboardLabelsColor = () => async (dispatch, getState) => {
const {
dashboardInfo: { id, metadata },
} = getState();
const categoricalSchemes = getCategoricalSchemeRegistry();
Function getCrossFilterDataMask
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(data, treePathInfo) => {
if (data?.children) {
return undefined;
}
const { treePath } = extractTreePathInfo(treePathInfo);
Function optionsForSelect
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const optionsForSelect = (
columns: ColumnMeta[],
formData: QueryFormData | null | undefined,
) => {
const options: OptionSortType[] = [
Function checkForRefresh
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const checkForRefresh = () => {
const shouldRequestChecking = shouldCheckForQueries(queries);
if (!pendingRequestRef.current && shouldRequestChecking) {
const params = rison.encode({
last_updated_ms: queriesLastUpdate - QUERY_UPDATE_BUFFER_MS,
Function handleSaveInDataset
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSaveInDataset = () => {
setLoading(true);
const selectedColumns = datasource?.columns ?? [];
// The filters param is only used to test jinja templates.