Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lgtm.com alerts: equality tests #11348

Merged
merged 2 commits into from
May 22, 2017
Merged

Fix lgtm.com alerts: equality tests #11348

merged 2 commits into from
May 22, 2017

Conversation

sj
Copy link
Contributor

@sj sj commented May 16, 2017

This PR fixes a number of alerts reported by lgtm.com (@lgtmhq). There is a good number of other alerts well worth looking at here: https://lgtm.com/projects/g/mrdoob/three.js/alerts/

You can set up automated pull request reviews on lgtm.com as well!

@mrdoob
Copy link
Owner

mrdoob commented May 18, 2017

@lgtmhq is cool! Not sure about your proposed fixes though... I'll have to take a closer look.

@@ -427,7 +427,7 @@ THREE.MMDLoader.prototype.pourVmdIntoCamera = function ( camera, vmd, name ) {

var clip = new THREE.AnimationClip( name === undefined ? THREE.Math.generateUUID() : name, -1, tracks );

if ( clip !== null ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@takahirox can clip be null here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe no.... I don't remember why I added this null check logic....
Seems like I should remove.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the history.
I used THREE.AnimationClip.parseAnimation() which can return null before.
Seems like I've forgotten to remove null check logic when I replaced it with new THREE.AnimationClip().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll fix them later!

@sj
Copy link
Contributor Author

sj commented May 19, 2017

@mrdoob @takahirox: thanks for your careful review, let me know if there's anything else I can do to help.

Would love to hear your feedback on the automated lgtm.com code review for GitHub pull requests. You can enable it here: https://lgtm.com/projects/g/mrdoob/three.js/ci/. That way you get notified of alerts before they get merged into master :)

@takahirox
Copy link
Collaborator

@sjvs
Would you please remove clip null check lines from MMDLoader in this PR?

@mrdoob mrdoob merged commit 62c93cc into mrdoob:dev May 22, 2017
@mrdoob
Copy link
Owner

mrdoob commented May 22, 2017

I'll clean all this.

mrdoob added a commit that referenced this pull request May 22, 2017
@mrdoob
Copy link
Owner

mrdoob commented May 22, 2017

Done. Thanks!

@mrdoob
Copy link
Owner

mrdoob commented May 23, 2017

@sjvs I spent the whole day yesterday fixing 200 alerts in https://lgtm.com/projects/g/mrdoob/three.js/ The page reported 810 alerts yesterday, today it reports 937... 🤔

@sj
Copy link
Contributor Author

sj commented May 23, 2017

@mrdoob: there was a slight glitch earlier today; things are on their way back to normal. We're in the process of re-analysing the most recent revision of three.js, results should appear soon on https://lgtm.com/projects/g/mrdoob/three.js/alerts/

We've just updated the queries that generate the alerts, which should result in fewer false positives and more true positives. Therefore, the number of alerts may not quite be the same as yesterday's minus 200.

Let me know if you see anything unexpected!

@mrdoob
Copy link
Owner

mrdoob commented May 23, 2017

@sjvs thank you! lovely service by the way!

@sj
Copy link
Contributor Author

sj commented May 23, 2017

No problem, @mrdoob - happy to help.

We're very keen to hear feedback from early adopters like yourself, especially regarding the automated reviews of pull requests which we recently introduced. Here's an example of how the guys at NASA's JPL are using it for PRs on one of their open-source projects: Open-MBEE/exec-cameo-mdk#105.

The automated review will catch any alerts so you can fix them before merging a PR into master. It'd be great if you could give that a go for Three.js, and let me know your feedback so we can improve :)!

You should be able to enable it here: https://lgtm.com/projects/g/mrdoob/three.js/ci/

@mrdoob
Copy link
Owner

mrdoob commented May 23, 2017

Yep, just added it. (First time I add anything tot this repo btw 😊)

@sj
Copy link
Contributor Author

sj commented May 23, 2017

Great - thanks! Now all we need is a new pull request to see it in action! You're one of the first users, so do let me know if there's anything you'd like to see improved. That's the perk of being an early adopter 😉

@mrdoob
Copy link
Owner

mrdoob commented May 23, 2017

Will do! 👍

amakaroff82 pushed a commit to amakaroff82/three.js that referenced this pull request May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants