editing JavaScript with Spreadsheet, getting statistics, also XMLrepresentation of Script.

Discussion in 'Javascript' started by pantagruel, Dec 3, 2007.

  1. pantagruel

    pantagruel Guest


    The company I work for currently has a really bad library of
    JavaScripts for its main web-based product (yet surprisingly better
    than its competitors), last week I had an idea to modify jslint to
    recurse over a filesystem of scripts and output an XML representation
    of each scripts errors. I then took that XML documentation of the
    errors and combined it with the output of some code I had written to
    dump an XML representation of all the JavaScript in the file. Output
    looks something like this (fragment follows)

    <errors count="4">
    - <error number="1">
    <reason>Line breaking error ')'.</reason>
    <comment>// form Element lookup</comment>

    Now the idea of this was to use the XML generated for various things,
    generation of graphs showing most common errors, reuse of definitions
    etc. As well as to place the XML in an XML database and query over it,
    which I have done the initial work of that.

    Originally I was going to use the XML to generate StatDataML to feed
    to R to do my statistics but then I had the weird idea, hey how about
    generating an Excel spreadsheet.

    I figured if I did that I could still manage to do the statistics but
    other opportunities come up, for example comparing multiple files and
    such in the spreadsheet, editing the files from the spreadsheet (not
    sure how good idea that is but it may be for controlling a large
    library of Scripts that a Spreadsheet may be useful, also because I am
    familiar with this strategy for generating XML from Excel)

    The structure I have for the spreadsheet so far is:

    Worksheet - the set of files in a particular folder, start new sheet
    for new folder.


    Filename Code
    Errors Comments

    The structure of code is basically each line of code is then entered
    in a row of code, for example the following fragment if(columnCount
    %7==0) { might be on a row in the code column, in the Errors column
    it will say Line: 230, character 29 Error Description: Use '==='
    to compare with '0'. Evidence: if (columnCount % 7 == 0) {
    and in the Comments column it will say // START A NEW ROW WHEN

    Now I realize that this may all be an example of misusing Excel such
    as I tend to hate, but it was quite easy to do so I did it, now that I
    look at it it doesn't look that irritating to work with (perhaps
    because I am suffering the early stages of Excel derangement syndrome)
    so what I would like is some comments on it, problems that one sees,
    improvements to structure (hoping comments are more constructive than
    you obviously know nothing about programming and you are an idiot that
    should die but hey, I can handle those as well)

    Also I am wondering if anyone is familiar with any other Excel based
    tools for working with JavaScript in a similar manner and how they
    work, their design, hard to google that kind of stuff so its easier to
    ask people that might know.

    Hope this misuse of several technologies at one sitting has not caused
    anyone to have a coronary.

    pantagruel, Dec 3, 2007
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. monika
    Apr 25, 2005
  2. jkwagh
    Default User
    Aug 3, 2005
  3. Replies:
  4. Paul
    Sebastian Hungerecker
    Apr 24, 2007
  5. lendle

Share This Page