Showing 2,441 of 6,157 total issues
Consider simplifying this complex logical expression. Open
Open
if (sourceType !== ANNOTATION_SOURCE_TYPES.NATIVE && slice) {
const columns = (slice.data.groupby || [])
.concat(slice.data.all_columns || [])
.map(x => ({ value: x, label: x }));
const timeColumnOptions = slice.data.include_time
Consider simplifying this complex logical expression. Open
Open
if (
!hasWarned &&
(isChildParentTagged ||
(isChildParentArrow && isParentTemplateLiteral)) &&
rawValue &&
Consider simplifying this complex logical expression. Open
Open
if imt(token, m=[(Keyword, "FROM"), (Keyword, "JOIN")]):
state = InsertRLSState.SEEN_SOURCE
# Found identifier/keyword after FROM/JOIN, test for table
elif state == InsertRLSState.SEEN_SOURCE and (
Consider simplifying this complex logical expression. Open
Open
if (
controlState.columns &&
(isAdhocMetricSimple(value) || isSimpleAdhocFilter(value)) &&
((!isEmpty(controlState.columns) &&
controlState.columns.some(
Consider simplifying this complex logical expression. Open
Open
if (
cachedFiltersByChart[sliceId] === filters &&
areObjectsEqual(cachedFormData?.color_scheme, colorScheme, {
ignoreUndefined: true,
}) &&
Consider simplifying this complex logical expression. Open
Open
if (
!importLoading &&
!alreadyExists.length &&
!passwordsNeeded.length &&
!sshPasswordNeeded.length &&
Function getCrossFilterDataMask
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getCrossFilterDataMask = source => {
const selected = Object.values(filterState.selectedValues || {});
const key = source.id || source.country;
const country =
countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.country;
Function transformProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function transformProps(chartProps) {
const { width, height, datasource, formData, queriesData } = chartProps;
const {
colorScheme,
dateTimeFormat,
Function renderFilterScopeTree
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderFilterScopeTree() {
const {
filterScopeMap,
activeFilterField,
checkedFilterFields,
Function transformedData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.map((datum: any) => {
const groupbyLabel = extractGroupbyLabel({
datum,
groupby: groupbyLabels,
coltypeMapping,
Function mapStateToProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mapStateToProps(explore, _, chart) {
const verboseMap = explore?.datasource?.hasOwnProperty(
'verbose_map',
)
? (explore?.datasource as Dataset)?.verbose_map
Function createTree
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createTree(rootNodeId: DataRecordValue): TreeSeriesNodeItemOption {
const rootNodeName = findNodeName(rootNodeId);
const tree: TreeSeriesNodeItemOption = { name: rootNodeName, children: [] };
const children: TreeSeriesNodeItemOption[][] = [];
const indexMap: { [name: string]: number } = {};
Function formatter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formatter: (param: CallbackDataParams) => {
// @ts-ignore
const {
value,
name,
Function getCrossFilterDataMask
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getCrossFilterDataMask = (node: DataRow | undefined) => {
if (!node?.name || !node?.col) {
return undefined;
}
const { name, col } = node;
Function embeddedPageInitializer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.addEventListener('message', function embeddedPageInitializer(event) {
try {
validateMessageEvent(event);
} catch (err) {
log('ignoring message unrelated to embedded comms', err, event);
Function fetchResource
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(resourceID: number) => {
// Set loading state
updateState({
loading: true,
});
Function simpleFilterToAdhoc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const simpleFilterToAdhoc = (
filterClause: QueryObjectFilterClause,
clause: Clauses = Clauses.Where,
) => {
let result: AdhocFilter;
Function downloadAsImage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function downloadAsImage(
selector: string,
description: string,
isExactSelector = false,
) {
Function onBreadcrumbClick
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(breadcrumb: DrillByBreadcrumb, index: number) => {
dispatch(
logEvent(LOG_ACTIONS_DRILL_BY_BREADCRUMB_CLICKED, {
slice_id: formData.slice_id,
}),
Function saveFilterBarOrientation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function saveFilterBarOrientation(orientation: FilterBarOrientation) {
return async (dispatch: Dispatch, getState: () => RootState) => {
const { id, metadata } = getState().dashboardInfo;
const updateDashboard = makeApi<
Partial<DashboardInfo>,