grass icon indicating copy to clipboard operation
grass copied to clipboard

v.cluster: Fix unused value assignment

Open ShubhamDesai opened this issue 1 year ago • 2 comments

This pull request fixes the issue identified by coverity scan (CID: 1270389)

The variable eps gets overwritten so initially assigned value is commented.

ShubhamDesai avatar Jul 23 '24 22:07 ShubhamDesai

We're unsure about the intention behind including both 90% and 99% confidence intervals. Was there originally a plan to have an option between 90% and 99%? Your suggestion to use comment the line is correct, but if we don't need the 90% interval, it might be better to remove that line entirely. Also, there's a similar case at line 289.

lbartoletti avatar Jul 24 '24 05:07 lbartoletti

Was there originally a plan to have an option between 90% and 99%?

These would be good things to catch when revising the code. Perhaps all is needed is to create an issue for a (possibly?) straightforward addition (good for beginners). I'm tagging original author @metzm and @neteler who contributed to the documentation quite a bit.

wenzeslaus avatar Aug 07 '24 21:08 wenzeslaus

I would remove the duplicate eps lines and move on.

petrasovaa avatar Sep 17 '24 14:09 petrasovaa

I would remove the duplicate eps lines and move on.

I agree. The meaning of the constant literal is documented and the possibility of switch between 99% and 90% is obvious, so there is no added value in keeping that line or a comment in the code.

wenzeslaus avatar Sep 17 '24 22:09 wenzeslaus

I would remove the duplicate eps lines and move on.

I agree. The meaning of the constant literal is documented and the possibility of switch between 99% and 90% is obvious, so there is no added value in keeping that line or a comment in the code.

Done removed the lines. Also in the documentation https://grass.osgeo.org/grass84/manuals/v.cluster.html it mentions "If the maximum distance is not specified with the distance option, the maximum distance is estimated from the observed distances to the neighbors using the upper 99% confidence interval."

so i guess it refers to the 99% confidence interval

ShubhamDesai avatar Sep 18 '24 23:09 ShubhamDesai