Open jainlokesh318 opened 11 months ago
@jainlokesh318 I'll work on this
@jainlokesh318 I have a few questions regarding this
1) There are some components/screens that are not being used currently such as src/components/DistributionDonut
, src/components/formOtpInput.res
, etc. Should I go ahead and delete them if they will not be required in the future?
2) Some properties of types are not currently being used such as source
& value
in src/components/SingleStats/SingleStatEntity.res
, etc. Should I remove them if they might not be used in the future?
3) Parameters of some functions are provided with default values but everywhere that the function is being called, a value is being provided for the parameter. The analyzer throws an error in such cases. Should I remove the default value? Ex: filterNull
parameter in chartDataMaker
function in src/components/CustomCharts/LineChartUtils.res
Hey @shubham0804 ,
I have a few further queries:
1) The Analyzer is giving false positives for a lot of context files. For example ./src/context/AddAttributesContext.res. Should I add @live
decorator to them?
2) The analyzer is showing a lot of warnings regarding the HSMixPanel
screen. One case is: In Button.res
it says that optional argument contextName of function hyperswitchMixPanel is always supplied (1 calls)
. But on removing the default argument of empty string of actionName
from HSMixPanel.useSendEvent
the warning is removed. But then it is found that actionName
parameter is not passed when calling HSMixPanel.useSendEvent
from FormRenderer.res
. Could this be a false positive from the analyzer or am I missing something here?
3) Is the objective to remove all dead code from the project and eventually run the analyzer in CI or to remove most of the dead code?
There are patches of code in the repo which are not used anymore, they can be removed. Rescript analyzer can be used to detect such code.