Showing 2,441 of 6,157 total issues
Function useContextMenu
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useContextMenu = (
chartId: number,
formData: BaseFormData & { [key: string]: any },
onSelection?: (...args: any) => void,
displayedItems?: ContextMenuItem[] | ContextMenuItem,
Function ServerPagination
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ServerPagination: StoryFn<typeof Table> = args => {
const [data, setData] = useState(generateData(0, 5));
const [loading, setLoading] = useState(false);
const handleChange: OnChangeFunction<BasicData> = (
Function selectIndicatorsForChart
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const selectIndicatorsForChart = (
chartId: number,
filters: { [key: number]: Filter },
datasources: { [key: string]: Datasource },
chart: any,
Function SqlLab
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function SqlLab() {
const lastInitializedAt = useSelector<SqlLabRootState, number>(
state => state.sqlLab.queriesLastUpdate || 0,
);
const { data, isLoading, isError, error, fulfilledTimeStamp } =
Function cleanDeletedParents
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const cleanDeletedParents = (values: NativeFiltersForm | null) => {
const modifiedParentFilters = new Set<string>();
const updatedFilterConfigMap = Object.keys(filterConfigMap).reduce(
(acc, key) => {
const filter = filterConfigMap[key];
Function saveDashboard
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
saveDashboard() {
const { saveType, newDashName } = this.state;
const {
dashboardTitle,
dashboardInfo,
Function useDefaultValue
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useDefaultValue = (
formFilter?: NativeFiltersFormItem,
filterToEdit?: Filter,
): [boolean, boolean, string, Function] => {
const enableEmptyFilter = !!formFilter?.controlValues?.enableEmptyFilter;
Function constructor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(config: ChartPropsConfig & { formData?: FormData } = {}) {
const {
annotationData = {},
datasource = {},
formData = {} as FormData,
Function actions.UPDATE_FORM_DATA_BY_DATASOURCE
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[actions.UPDATE_FORM_DATA_BY_DATASOURCE]() {
const newFormData = { ...state.form_data };
const { prevDatasource, newDatasource } = action;
const controls = { ...state.controls };
const controlsTransferred = [];
Function sliceEntitiesReducer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function sliceEntitiesReducer(
state = initSliceEntities,
action,
) {
const actionHandlers = {
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
super({
buildQuery,
controlPanel,
loadChart: () => import('../../EchartsTimeseries'),
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
showTrendLine,
height,
kickerFontSize,
Function transform
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transform(
targetVizType: string,
exploreState: Record<string, any>,
): {
formData: QueryFormData;
Function buildQuery
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function buildQuery(formData: PivotTableQueryFormData) {
const { groupbyColumns = [], groupbyRows = [], extra_form_data } = formData;
const time_grain_sqla =
extra_form_data?.time_grain_sqla || formData.time_grain_sqla;
Function useGetTimeRangeLabel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useGetTimeRangeLabel = (adhocFilter: AdhocFilter): Results => {
const [actualTimeRange, setActualTimeRange] = useState<Results>({});
useEffect(() => {
if (
Function renderHeader
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderHeader = () => {
const element: HTMLInputElement | null = tableNameRef.current;
let trigger: string[] = [];
if (element && element.offsetWidth < element.scrollWidth) {
trigger = ['hover'];
Function renderErrorMessage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderErrorMessage(queryResponse: ChartErrorType) {
const {
chartId,
chartAlert,
chartStackTrace,
Function setDatabaseModel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setDatabaseModel = (database_name: string) => {
if (database_name === 'Other') {
// Allow users to connect to DB via legacy SQLA form
setDB({
type: ActionType.DbSelected,
Function useFilterControlFactory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useFilterControlFactory = (
dataMaskSelected: DataMaskStateWithId,
onFilterSelectionChange: (filter: Filter, dataMask: DataMask) => void,
) => {
const filters = useFilters();
Function fetchDashboards
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fetchDashboards = async (
filterValue = '',
page: number,
pageSize: number,
) => {