IuryNogueira/myreef

View on GitHub
front/src/components/Indicator/Indicator.tsx

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 3 of 3 total issues

Function Indicator has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const Indicator = (props: config) => {
const { name, value, unit, alarm, icon, loading, last_update } = props.config;
const [loadingState, setLoadingState] = useState<boolean>(false);
 
useEffect(() => {
Severity: Minor
Found in front/src/components/Indicator/Indicator.tsx - About 2 hrs to fix

Avoid too many return statements within this function.
Open

return 'ideal seria menor ou igual a ' + alarm?.values[0];
Severity: Major
Found in front/src/components/Indicator/Indicator.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

    return 'ideal seria maior ou igual a ' + alarm?.values[0];
    Severity: Major
    Found in front/src/components/Indicator/Indicator.tsx - About 30 mins to fix
      Category
      Status