jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Sonar Plugins
  • Sonar Plugins
  • SONARPLUGINS-1806

Rule: Avoid usage of eval

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JAVASCRIPT-1.0
  • Component/s: JavaScript
  • Labels:
    None
  • Number of attachments :
    0

Issue Links

depends upon

New Feature - A new feature of the product, which has yet to be developed. SONARPLUGINS-1788 Provide JavaScript rule engine based on SSLR

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Evgeny Mandrikov made changes - 11/May/12 11:58 PM
Field Original Value New Value
Link This issue depends upon SONARPLUGINS-1788 [ SONARPLUGINS-1788 ]
Evgeny Mandrikov made changes - 12/May/12 1:09 AM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Evgeny Mandrikov [ godin ] Freddy Mallet [ freddy.mallet ]
Resolution Fixed [ 1 ]
Hide
Permalink
Freddy Mallet added a comment - 15/May/12 7:53 AM - edited

Works well Evgeny.

Could you just update the description as follows :

<p>The eval() function in javascript is a way to run arbitrary code at run-time. In almost all cases, eval should never be used. If it exists in your page, there is almost always a more correct way to accomplish what you are doing.

The rule is, "Eval is evil." Don't use it unless you are an experienced developer and know that your case is an exception.</p>

<p>
The following code snippet illustrates this rule :
</p>

<pre>
var myCode = 'alert("Howdy?");';
eval(myCode);     //NOK
</pre>
Show
Freddy Mallet added a comment - 15/May/12 7:53 AM - edited Works well Evgeny. Could you just update the description as follows : <p>The eval() function in javascript is a way to run arbitrary code at run-time. In almost all cases, eval should never be used. If it exists in your page, there is almost always a more correct way to accomplish what you are doing. The rule is, "Eval is evil." Don't use it unless you are an experienced developer and know that your case is an exception.</p> <p> The following code snippet illustrates this rule : </p> <pre> var myCode = 'alert("Howdy?");'; eval(myCode); //NOK </pre>
Freddy Mallet made changes - 15/May/12 7:53 AM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Assignee Freddy Mallet [ freddy.mallet ] Evgeny Mandrikov [ godin ]
Evgeny Mandrikov made changes - 15/May/12 3:56 PM
Status Reopened [ 4 ] In Progress [ 3 ]
Hide
Permalink
Evgeny Mandrikov added a comment - 16/May/12 1:37 AM

Done.

Show
Evgeny Mandrikov added a comment - 16/May/12 1:37 AM Done.
Evgeny Mandrikov made changes - 16/May/12 1:37 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Assignee Evgeny Mandrikov [ godin ] Freddy Mallet [ freddy.mallet ]
Resolution Fixed [ 1 ]
Hide
Permalink
Freddy Mallet added a comment - 18/May/12 6:47 AM

Manually tested !

Show
Freddy Mallet added a comment - 18/May/12 6:47 AM Manually tested !
Freddy Mallet made changes - 18/May/12 6:47 AM
Assignee Freddy Mallet [ freddy.mallet ] Evgeny Mandrikov [ godin ]
Evgeny Mandrikov made changes - 22/May/12 4:17 AM
Status Resolved [ 5 ] Closed [ 6 ]

People

  • Assignee:
    Evgeny Mandrikov
    Reporter:
    Evgeny Mandrikov
Vote (0)
Watch (0)

Dates

  • Created:
    11/May/12 11:51 PM
    Updated:
    22/May/12 4:17 AM
    Resolved:
    16/May/12 1:37 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.