Showing 364 of 1,154 total issues
Function PrivacyPolicy
has 660 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrivacyPolicy: React.FC = () => {
return (
<section className="bg-white">
<Wrapper>
<div className="pt-12 pb-10 space-y-10 md:pt-32 md:pb-16 md:w-8/12">
File component.tsx
has 1034 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useEffect, useMemo, useRef } from 'react';
import { useRouter } from 'next/router';
import { useForm, Controller } from 'react-hook-form';
import { RadioGroup, Disclosure } from '@headlessui/react';
import { yupResolver } from '@hookform/resolvers/yup';
File FlowMapSelectors.ts
has 1034 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright 2022 FlowmapBlue
* Copyright 2018-2020 Teralytics, modified by FlowmapBlue
*
* Licensed under the Apache License, Version 2.0 (the "License");
Function AnalysisTable
has 381 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AnalysisTable = () => {
const [paginationState, setPaginationState] = useState<PaginationState>({
pageIndex: 1,
pageSize: DEFAULT_PAGE_SIZES[0],
});
Function MoreFilters
has 316 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MoreFilters = () => {
const { query } = useRouter();
const { scenarioId, compareScenarioId } = query;
const dispatch = useAppDispatch();
File h3-data.repository.ts
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Brackets,
DataSource,
ObjectLiteral,
Repository,
File component.tsx
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Wrapper from 'containers/wrapper';
import Link from 'next/link';
const PrivacyPolicy: React.FC = () => {
return (
Function Contact
has 257 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Contact: React.FC = () => {
const [submitting, setSubmitting] = useState(false);
const [success, setSuccess] = useState(false);
const { query } = useRouter();
FlowMapSelectors
has 66 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class FlowMapSelectors<L, F> {
accessors: FlowMapAggregateAccessors<L, F>;
constructor(accessors: FlowMapDataAccessors<L, F>) {
this.accessors = new FlowMapAggregateAccessors(accessors);
Function up
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE OR REPLACE FUNCTION get_h3_uncompact_geo_region(geo_region_id uuid, h3_resolution int)
RETURNS TABLE (h3index h3index) AS
$$
File component.tsx
has 540 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';
import classNames from 'classnames';
import {
flip,
offset,
Function buildIndex
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
Open
export function buildIndex<F>(clusterLevels: ClusterLevels): ClusterIndex<F> {
const nodesByZoom = new Map<number, ClusterNode[]>();
const clustersById = new Map<string, Cluster>();
const minZoomByLocationId = new Map<string, number>();
for (const { zoom, nodes } of clusterLevels) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function InnerTreeSelect
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
Open
const InnerTreeSelect = <IsMulti extends boolean>(
{
current: currentRaw,
loading,
maxBadges = 5,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function UpdateScenarioPage
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UpdateScenarioPage: React.FC = () => {
const { query } = useRouter();
const queryClient = useQueryClient();
const { data, isLoading } = useScenario(query?.scenarioId as string, { include: 'user' });
const updateScenario = useUpdateScenario();
Function ScenariosAdminPage
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ScenariosAdminPage: React.FC = () => {
const router = useRouter();
const { query } = router;
const [scenatioToDelete, setScenatioToDelete] = useState<string>(null);
Function saveNewIntervention
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async saveNewIntervention(
newIntervention: ScenarioIntervention,
): Promise<any> {
const queryRunner: QueryRunner = this.dataSource.createQueryRunner();
await queryRunner.connect();
Function Step03
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Step03: React.FC = () => {
return (
<article
className={cx({
'flex flex-col lg:flex-row-reverse justify-between space-y-10 lg:space-x-10 lg:space-x-reverse lg:space-y-0':
File colors.ts
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
interpolateCool,
interpolateInferno,
interpolateMagma,
interpolatePlasma,
File scenario-vs-scenario.service.ts
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Injectable, Logger } from '@nestjs/common';
import {
GetActualVsScenarioImpactTableDto,
GetScenarioVsScenarioImpactTableDto,
ORDER_BY,
File component.tsx
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useCallback, useEffect, useMemo, useState } from 'react';
import { DownloadIcon, InformationCircleIcon } from '@heroicons/react/outline';
import { uniq, omit } from 'lodash-es';
import { ArrowLeftIcon } from '@heroicons/react/solid';