[RNG] LGTM analysis (Was: [...] branch master updated: Badge.)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[RNG] LGTM analysis (Was: [...] branch master updated: Badge.)

Gilles Sadowski-2
Hello.

"Commons RNG" page on GitHub[1] now links to the LGTM report[2].

Unfortunately, the one "alert" there[3] is a false positive.
Perhaps, we could make it go away by rewriting the "while" loop
as a "for" loop... (or changing the bound to "size - 1").

Regards,
Gilles

[1] https://github.com/apache/commons-rng
[2] https://lgtm.com/projects/g/apache/commons-rng/context:java
[3] https://lgtm.com/projects/g/apache/commons-rng/snapshot/8504c91b999959c38e97a69ed1d9f71f41e3bd40/files/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/Long2IntArray.java

> [...]
>
> commit 5461d28594d006365b20a4748957656208c3a599
> Author: Gilles Sadowski <[hidden email]>
> AuthorDate: Thu Oct 24 17:08:08 2019 +0200
>
>     Badge.
> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [RNG] LGTM analysis (Was: [...] branch master updated: Badge.)

Alex Herbert


> On 24 Oct 2019, at 16:23, Gilles Sadowski <[hidden email]> wrote:
>
> Hello.
>
> "Commons RNG" page on GitHub[1] now links to the LGTM report[2].
>
> Unfortunately, the one "alert" there[3] is a false positive.
> Perhaps, we could make it go away by rewriting the "while" loop
> as a "for" loop... (or changing the bound to "size - 1”).

I saw that.

The loop was written to avoid an if statement within the loop. I’ll see if a variant can pass the LGTM check.

Alex


>
> Regards,
> Gilles
>
> [1] https://github.com/apache/commons-rng
> [2] https://lgtm.com/projects/g/apache/commons-rng/context:java
> [3] https://lgtm.com/projects/g/apache/commons-rng/snapshot/8504c91b999959c38e97a69ed1d9f71f41e3bd40/files/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/Long2IntArray.java
>
>> [...]
>>
>> commit 5461d28594d006365b20a4748957656208c3a599
>> Author: Gilles Sadowski <[hidden email]>
>> AuthorDate: Thu Oct 24 17:08:08 2019 +0200
>>
>>    Badge.
>> [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [RNG] LGTM analysis (Was: [...] branch master updated: Badge.)

sebb-2-2
On Thu, 24 Oct 2019 at 16:36, Alex Herbert <[hidden email]> wrote:

>
>
>
> > On 24 Oct 2019, at 16:23, Gilles Sadowski <[hidden email]> wrote:
> >
> > Hello.
> >
> > "Commons RNG" page on GitHub[1] now links to the LGTM report[2].
> >
> > Unfortunately, the one "alert" there[3] is a false positive.
> > Perhaps, we could make it go away by rewriting the "while" loop
> > as a "for" loop... (or changing the bound to "size - 1”).
>
> I saw that.
>
> The loop was written to avoid an if statement within the loop. I’ll see if a variant can pass the LGTM check.

If you do change the code, best to add a comment as to why the
particular syntax is being used.

> Alex
>
>
> >
> > Regards,
> > Gilles
> >
> > [1] https://github.com/apache/commons-rng
> > [2] https://lgtm.com/projects/g/apache/commons-rng/context:java
> > [3] https://lgtm.com/projects/g/apache/commons-rng/snapshot/8504c91b999959c38e97a69ed1d9f71f41e3bd40/files/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/Long2IntArray.java
> >
> >> [...]
> >>
> >> commit 5461d28594d006365b20a4748957656208c3a599
> >> Author: Gilles Sadowski <[hidden email]>
> >> AuthorDate: Thu Oct 24 17:08:08 2019 +0200
> >>
> >>    Badge.
> >> [...]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]