Showing 8 of 22 total issues
Function PropertyDetail
has a Cognitive Complexity of 68 (exceeds 25 allowed). Consider refactoring. Open
const PropertyDetail = (props: IPropertyDetail) => {
const navigate = useNavigate();
const params = useParams();
const { keycloak } = useContext(AuthContext);
const { getLookupValueById } = useContext(LookupContext);
- 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 PropertyTable
has a Cognitive Complexity of 53 (exceeds 25 allowed). Consider refactoring. Open
const PropertyTable = (props: IPropertyTable) => {
const [totalCount, setTotalCount] = useState(0);
const api = usePimsApi();
const { navigateAndSetFrom } = useHistoryAwareNavigate();
const snackbar = useContext(SnackBarContext);
- 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 FilterSearchDataGrid
has a Cognitive Complexity of 43 (exceeds 25 allowed). Consider refactoring. Open
export const FilterSearchDataGrid = (props: FilterSearchDataGridProps) => {
const DEFAULT_PAGE = 0;
const DEFAULT_PAGESIZE = 100;
const [searchParams, setSearchParams] = useSearchParams();
- 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 ProjectDetail
has a Cognitive Complexity of 36 (exceeds 25 allowed). Consider refactoring. Open
const ProjectDetail = (props: IProjectDetail) => {
const navigate = useNavigate();
const { id } = useParams();
const { keycloak } = useContext(AuthContext);
const lookup = useContext(LookupContext);
- 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 ParcelMap
has a Cognitive Complexity of 31 (exceeds 25 allowed). Consider refactoring. Open
const ParcelMap = (props: ParcelMapProps) => {
const MapEvents = () => {
useMapEvents({
resize: () => {
setPopupState({ ...popupState, open: false });
- 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
Avoid deeply nested control flow statements. Open
if (!notifExists) {
//If there is no notification like this already pending, we send one.
const sendOn = new Date(mostRecentStatusChangeDate.getTime());
sendOn.setDate(mostRecentStatusChangeDate.getDate() + statusNotif.DelayDays);
//We set the delay by the most recent status change date plus the number of delay days. This should make these new emails
Function usePropertiesApi
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
const usePropertiesApi = (absoluteFetch: IFetch) => {
const config = useContext(ConfigContext);
const keycloak = useSSO();
const propertiesFuzzySearch = async (keyword: string) => {
- 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 importPropertiesAsJSON
has a Cognitive Complexity of 26 (exceeds 25 allowed). Consider refactoring. Open
const importPropertiesAsJSON = async (
worksheet: WorkSheet,
user: User,
roles: string[],
resultId: number,
- 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"