frontend/src/components/MapCenter.tsx   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 14
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A MapCenter.tsx ➔ MapCenter 0 9 1
1
import { useMap } from 'react-leaflet';
2
import { LatLngExpression } from 'leaflet';
3
import { useEffect } from 'react';
4
5
export default function MapCenter({ center, zoom }: { center: LatLngExpression; zoom: number }) {
6 6
    const map = useMap();
7
8 6
    useEffect(() => {
9 6
        map.setView(center, zoom);
10
    }, [center, zoom, map]);
11
12 6
    return null;
13
}
14