brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Code Quality / Analyzability tool #3676

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by dwilmer Tuesday May 21, 2013 at 08:49 GMT Originally opened as https://github.com/adobe/brackets/issues/3936


JavaScript is a dynamically typed language with functions as first class citizens. Therefore it can be quite hard to analyze JavaScript code, for example to find out what function is actually called. RequireJS makes it easier, as long as best practices are followed.

To assess JavaScript and RequireJS analyzability, we created a tool that investigates imports and dependencies (following the require(...) functions) and analyzes function call tracability: how easy is it to determine what function is called. One of the factors we included is correct naming of modules: when a module is included using require, it is correctly named if the variable it is assigned to has the same name as the module itself (ignoring upper and lower case).

We found three categories of function calls:

We would like you to provide feedback on these decisions, so we can improve the tool to better suit the needs of Brackets' developers, and potentially many more:

  1. Do these categories clearly represent how easy it is to analyze code?
  2. Are there more, or more fine-grained, categories that you want to find?
  3. Are there exceptions to these categories, like special objects, and would you like to maintain these exceptions?

We (@dcharkes,@dwilmer,@intel478 and@JanJaapT) are students at Delft University of Technology. Our contributions are done within the context of the Software Architecture course of the Computer Science Master (@delftSWA on twitter).

core-ai-bot commented 3 years ago

Comment by dwilmer Tuesday May 21, 2013 at 09:04 GMT


By the way: the tool is hosted here on github, and the first results can be found here. The tool is currently very basic and outputs an html file containing the report. We intend to improve this, to increase usefulness for this and other projects.

core-ai-bot commented 3 years ago

Comment by njx Tuesday May 21, 2013 at 21:20 GMT


Hi@dwilmer - this sounds very interesting. This issue tracker is actually only for bugs/feature requests for Brackets. The best place for you to post about your work is on the brackets-dev Google Group at https://groups.google.com/forum/?fromgroups#!forum/brackets-dev - please repost there.

Also, are you aware of Tern - https://github.com/marijnh/tern? That's a project that does static analysis of JavaScript files in order to provide code hinting and other kinds of code intelligence. We're using it for our code hinting in Brackets. I believe it does some amount of dataflow analysis in order to figure out what functions are actually called, and in some cases I believe it can do things like trace back function definitions through module exports even if the names are different (see discussion in #3863). Might be interesting for your work.

Closing this since it's not a bug.