IuryNogueira/myreef

View on GitHub

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

const dummySensors: Sensor[] = [
{ id: 'a2134', name: 'Sensor 1', value: true },
{ id: '12323', name: 'Sensor 2', value: true }
];
Severity: Minor
Found in thereef/src/app/app.component.spec.ts and 1 other location - About 45 mins to fix
thereef/src/infrastructure/repositories/SensorRepository.spec.ts on lines 35..38

Identical blocks of code found in 2 locations. Consider refactoring.
Open

const dummySensors: Sensor[] = [
{ id: 'a2134', name: 'Sensor 1', value: true },
{ id: '12323', name: 'Sensor 2', value: true }
];
thereef/src/app/app.component.spec.ts on lines 36..39

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