IuryNogueira/myreef

View on GitHub

Showing 5 of 7 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

Function Select has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const Select = ({
options,
labelValue = 'name',
keyValue = 'id',
setOptionSelected,
Severity: Minor
Found in front/src/components/Select/Select.tsx - About 1 hr to fix

Function Dashboard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const Dashboard = () => {
const indicators: IndicatorProps[] = [
{
value: 27,
unit: 'celsius',
Severity: Minor
Found in front/src/pages/Dashboard/Dashboard.tsx - About 35 mins 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
      Severity
      Category
      Status
      Source
      Language