APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

EJSS lint checker post and replies

Return to the EJSS lint checker thread
Login to post to this thread

EJSS lint checker - December 18, 2019 at 5:30
Cleon Teunissen
25 Posts

In the simulation I'm currently porting to EJSS I get quite a lot of lint errors.

I have a general idea of what lint checkers such as JSlint and JShint do.

Is is normal to get that many lint errors?


Attached file:
lint_notifications.txt

Attached File: lint_notifications.txt


Replies to EJSS lint checker

Re: EJSS lint checker - December 19 2019 7:46
lookang Avatar
lookang
208 Posts

Yes it is normal.

My tutorial on how to convert ejs to ejss.

https://iwant2study.org/ospsg/index.php/translations/359-re-create-or-convert-ejs-to-ejss

Typically I would recommend a bite size step by step code inclusion/conversion of java to JavaScript so that debugging is targeted, so as to ease progression.

It is very demoralizing to see so many errors.


OSP@SG blog
OSP@SG Digital Library


Re: EJSS lint checker - December 19 2019 4:53
Cleon Teunissen
25 Posts

Well, indirectly you are confirming that what I'm seeing is unusual.

I infer from your reply that you are unaware of what a lint checker is, and the kind of warnings that a lint checker produces.

These lint errors show up as I click to make EJSS generate a simulation. The lint warning are for EJSS code, not for my code.

Running the simulation is something that I haven't done yet. First I want to get the UI right



Re: EJSS lint checker - December 20 2019 2:46
Wolfgang
122 Posts

Lint is a code analysis tool used for checking if JavaScript source code complies with coding rules and best practice.  For example, it is best practice to end a JavaScript statement with a semicolon the syntax does not require it.

The lint checker flags code the uses of the JavaScript eval function as a potential security threat.  It is unlikely that this is the case when evaL is used to parse user-entered functions, but the lint program does not know how eval is being used and issues the warning.  See the Stack Overflow discussion about the use of eval in JavaScript.


https://stackoverflow.com/questions/197769/when-is-javascripts-eval-not-evil



Re: EJSS lint checker - December 20 2019 4:47
Cleon Teunissen
25 Posts

It occurred to me: something isn't making sense: the lint checker messages that I see are for EJsS code, not for code that I wrote. That is, the messages are about EJsS internals, and it makes no sense for them to be displayed in an end user panel.

(See the attached screenshot)

The source of the lint checker messages is unclear.

Oracle has swapped out Javascript engine twice. There was a move to the Nashorn javascript engine, and later a move to the GraalVM.
(I'm using Java 8)
I don't know whether any of this is relevant. But the general impression I get that with Java under Oracle stewardship Java is becoming a moving target.


So my best guess is that displaying those lint checker messages is accidental, not intended.


I remember Paco mentioning that he has Windows running in a Virtual Machine, to test Windows environment. I suppose that the lint checker messages did not and do not appear in Paco's testing setup.

Attached File: EJSS_screenshot.png



The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics