Showing 438 of 1,408 total issues
Function getAvailableYearsForContextualLayer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getAvailableYearsForContextualLayer(yearsRequestParams: {
layerType: LAYER_TYPES;
h3DataIds?: string[] | null;
indicatorId?: string;
}): Promise<number[]> {
Function getYears
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getYears(yearsRequestParams: {
layerType: LAYER_TYPES;
h3DataIds?: string[] | null;
indicatorId?: string;
}): Promise<number[]> {
Function saveGeoRegionAsRadius
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async saveGeoRegionAsRadius(
newGeoRegionValues: LocationGeoRegionDto,
): Promise<string> {
const selectQuery: SelectQueryBuilder<any> = this.dataSource
.createQueryBuilder()
Function up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE OR REPLACE FUNCTION sum_weighted_water_over_georegion(
geo_region_id uuid
)
Function intercept
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async intercept(
context: ExecutionContext,
next: CallHandler,
): Promise<Observable<any>> {
if (this.scenarioAcl.isUserAdmin()) {
Function getEntityAncestryFlatArray
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getEntityAncestryFlatArray<Entity extends ObjectLiteral>(
queryBuilder: SelectQueryBuilder<Entity>,
entityName: string,
): Promise<Entity[]> {
const [subQuery, subQueryParams]: [string, any[]] =
Function isComparisonRequestAuthorized
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async isComparisonRequestAuthorized(
request: Request,
additionalChecks: ScenarioCheckWhiteListOptions,
): Promise<boolean> {
const baseScenarioId: string = request.query.baseScenarioId as string;
Function up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
'DROP MATERIALIZED VIEW IF EXISTS impact_materialized_view;',
);
await queryRunner.query(`
Function down
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE OR REPLACE FUNCTION sum_weighted_water_over_georegion(
geo_region_id uuid
)
Function handleSourceDataSelect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private handleSourceDataSelect(
queryBuilder: SelectQueryBuilder<SourcingRecord>,
dto: GetImpactTableDto,
): SelectQueryBuilder<SourcingRecord> {
if (dto.scenarioId) {
Function Search
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Search: FC<SearchProps> = ({ ...props }: SearchProps) => {
const { placeholder } = props;
const state = useSearchFieldState(props);
const ref = useRef();
Function TheServicePage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TheServicePage: NextPage<PageProps> = () => {
return (
<ApplicationLayout>
<>
<Head>
Function PrivacyPolicyPage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrivacyPolicyPage: NextPage<PageProps> = () => {
return (
<ApplicationLayout>
<>
<Head>
Function Compliance
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Compliance: React.FC = () => {
useEffect(() => {
let timerId: number;
if (window.location.hash && document.querySelector(window.location.hash)) {
Function handleDownloadData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleDownloadData = useCallback(async () => {
let csv = null;
// actual vs scenario
if (!currentScenario && scenarioToCompare) {
csv = await downloadActualVsScenarioData.mutateAsync({
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(): JSX.Element {
return (
<Html className="h-full bg-gray-100">
<Head>
<meta
Function Page404
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Page404: React.FC = () => {
const handleGoBack = useCallback(() => Router.back(), []);
return (
<div className="flex h-screen place-items-center justify-center">
Function paramsToQueryInjector
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const paramsToQueryInjector = (
params: string[],
query: string,
): string => {
while (query.includes('$')) {
Function generateNewLocationForChangeProductionEfficiency
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateNewLocationForChangeProductionEfficiency(
sourcingLocations: SourcingLocation[],
): SourcingLocation[] {
const newLocations: SourcingLocation[] = [];
for (const location of sourcingLocations) {
Function baseQueryExtend
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const baseQueryExtend = (baseQuery: SelectQueryBuilder<any>): void => {
//Add selection criteria to also select both comparedScenario in the select statement
baseQuery
.leftJoin(
ScenarioIntervention,