nhsx / antibody-web

Web application for finger prick covid19 antibody Lateral Flow Tests (LFT) and interpreting results
MIT License
28 stars 10 forks source link

Top level elements inside arrays should have the 'key' attribute set to allow React to efficiently rerender the elements of the array. Add the attribute 'key' to and set it to a unique value for each element of the array. #55

Closed thebpc closed 4 years ago

thebpc commented 4 years ago

File:client/src/components/TestRun/ContentComponent/ ReportKit.tsx Line: 26

See full details here (gitHub login required, no need to enable any repos for review at first): https://www.deepcode.ai/app/gh/nhsx/antibody-web/cf6264b4adb7f795ea5e23ef367ac34e951383ba/_/%2Fclient%2Fsrc%2Fcomponents%2FTestRun%2FContentComponent%2FReportKit.tsx/javascript%2Fdc%2FReactMissingArrayKeys/26/code and how 2606 other repos have already fixed that.

More details on the problem are explained here: https://reactjs.org/docs/lists-and-keys.html

There are 2 other suggestion detected: https://www.deepcode.ai/app/gh/nhsx/antibody-web/cf6264b4adb7f795ea5e23ef367ac34e951383ba/_/dashboard -"No catch method for promise. This may result in an unhandled promise rejection." -"for in loop is looping over all property names of this object, including properties defined in super classes. Consider filtering out only the own properties of the object by using hasOwnProperty."

barnc commented 4 years ago

Seems to be a bot selling a product.

thebpc commented 4 years ago

Hi, I am not a bot. I just found the issues through the DeepCode.ai service, which is reporting issues with over 80% accuracy. I think it is still worthwhile for you to look into it.