GithubHelp home page GithubHelp logo

ualberta-smr / libcompplugin Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 238.8 MB

An IntelliJ plugin for comparing libraries

Home Page: http://smr.cs.ualberta.ca/comparelibraries

License: MIT License

Java 99.70% Assembly 0.30%

libcompplugin's People

Contributors

relhajj avatar snadi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

unclesamtech

libcompplugin's Issues

Highlighting Options in LibComp

Need to decide whether we will keep highlighting a line w/ a package or not.

User should be able to control this. Give them the option to click on "No longer highlight alternatives for X domain" in the interface.

Also, what if they click do not show X domain and then later change their mind, what then? Therefore, should be somewhere to re-set.

Colors make things not visible

If I click on a metric value by mistake, this is what I get:

image

Can we make the metrics not clickable to avoid this, unless they are expected to do something?

Also, I just noticed that I can't seem to see the replace button

Migrate API usage after replacing libraries

Right now, any existing code that uses the old library will contain build errors after the replacement happens. This is an additional research topic on how to migrate the usages to the new library to reduce the overhead on the developers. Or some smart idea to avoid creating so many build errors.

Change plugin group and name

Change group to: smr.cs.ualberta.ca
Change name to: libcompplugin

When I initially tried this, the plugin stopped working. So I will need to read about how to do this.

An online source mentioned externally changing the name in the settings.gradle file then rebuilding the project but this also did not work.

REST api response formatting

Right now, the json responses are actually not recognized as json format b/c there are no surrounding curly brackets at the beginning and end.

Format should be like this:

Libraries {
ALL OF THE JSON, EXACTLY AS IT IS NOW
}

As a workaround, I just added the "Libraries {" and "}" at the beginning and end then the json library im using could recognize it and everything worked out fine.

If we change the API response, it will just remove that one extra step I have in my code.

Move all paths to a config file

Comment from PR:
It might be a good idea (perhaps open a new enhancement issue) to move all urls, paths etc to a configuration file. let's say we changed the REST API urls, we shouldn't need to edit or recompile the code.

Add URL links to maven repository entries for all libraries

Insert a commented url with each replacement on the build.gradle file.
The comment will be a URL that takes user to that library entry in the maven repository where they can see info on that library and the version number etc.

This would require these changes:

  • add a URL column in the libcomp DB on smr and populate all 50 libraries with the relevant links
  • add the URL to the GET API when we get all of the library data
  • change the replacement string in the plugin

More structured gradle parsing

Right now, it seems we use text-based regular expressions for parsing gradle dependencies. Similar to how we use PSI for Java files, there must be a parser for gradle files that we can use (Given that IntelliJ can recognize incorrect syntax there)

Security of data exchange

Right now, we rely on direct connections to the MySQL DB on the server. This means we need to store the DB username and password in plaintext in some config files that will get distributed with the app. This is extremely insecure. A better design is to create a REST API (See 1 and 2) on SMR that allows us to access this data.

I have already set up an API end point for getting library information: http://smr.cs.ualberta.ca/comparelibraries/libraries/ (See related PR in the website repo))

Since this is public information and is just a GET from the DB that displays the same info already publicly available on our website, we don't need any authentication for it. The response is a JSON object.

Thus, right now, instead of querying the MySQL DB directly, you will need to process the JSON response from this API. The good news is that I could build this REST API directly using the existing data model in django and using the sqlite DB. This means you no longer need to change things to use MySQL (unless we want to do so for the feedback data to scale better but we should discuss this).

I will still create an end point for pushing the feedback to the server but I'm not sure where the DB model for that feedback data is and whether it makes more sense to make it into a MySQL DB.

Also, are there other queries you do to the DB? For example, i remember there is some counter or date check you do to decide to update the library data in the plugin or not. Basically, I need to know all the queries you currently do to create the minimum set of endpoints needed. For instance, it doesn't make sense to get all the library information if we just need to check the last update date.

Implement user evaluation feedback system

Have a system where users can fill in questions themselves about the plugin.
This way we can collect info on what types of programmers they are / occupations / how useful they find the plugin etc.

For this, have to look into any possible privacy issues that may arise.
Must give them the option to NOT give us this info. It is optional.

Look into:

  • how other tools evaluated papers
  • specific tasks to give participants
  • what are we trying to evaluate?
  • size: 10-20 people?

GDPR compliance

Currently, LibComp does not collect any personally identifying data except the name of projects and files. We do not collect names, emails, phone numbers etc. Developers may ask us to delete their personal data if they provide us with their unique identifier which they have access to. Data is communicated through an encrypted channel (https) to our server, which sits on the university network. We do not collect any of this data unless the user has given us explicit consent.

I believe all these factors make us GDPR compliant, but we need to investigate further if we can claim so. Perhaps there should be a privacy statement added to the repo here?

One issue is that in the case of a breach, we do not have a way to notify our users since we do not collect their emails. We could implement something that communicate with the plugin so that anyone who has the plugin installed gets a notification (e.g., on IDE start, plugin checks for any security breach logged on the server). I'm not sure though if this is really needed since no personal info is collected.

Implement LibComp for build.gradle

  • Allow library comparison to occur from the build.gradle file.
  • dependencies with "groups" we have in our DB will be highlighted and replaced
  • "group" will map to package, "name" is the library name, and for "version" we will link to the maven repository so that the developer/user can input relevant version number

Conduct User study

How many participants are needed for a respectable user evaluation?
What if we ask a class of high level computer science students to conduct the study?
I will make it an online questionnaire.

Interaction data not being sent

I was testing out the plugin version from PR #38 and I could not see the interaction data on the server. I tried explicitly clicking the send data button as well as just leaving the checkbox checked and trying new feedback, but no new entries appeared in the DB. Do you know what is going on?

Colors don't appear well in dark mode & buttons disappear

We still have the problem of colors not showing well in dark mode, but worse the buttons disappear once I start interacting with the dialog (e.g., clicking on the sort up/down buttons):

image

The color choice is something we can fix later, but @relhajj, do you do anything on sorting that could cause the buttons to disappear?

ArrayIndexOutOfBoundException for gradle dependencies

This wasn't happening before but today when trying libcomp in a gradle file, I got an exception in this line

selectedTerm = valuesInQuotes[0];

as follows:

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at smr.cs.ualberta.libcomp.action.ReplacementAction.detectDependancy(ReplacementAction.java:163)
	at smr.cs.ualberta.libcomp.action.ReplacementAction.detectAllOpenEditors(ReplacementAction.java:132)
	at smr.cs.ualberta.libcomp.action.ReplacementAction.update(ReplacementAction.java:218)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:177)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:453)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$null$1(ActionUpdater.java:93)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:133)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$2(ActionUpdater.java:94)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:435)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:296)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$19(ActionUpdater.java:275)
	at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1712)

Wrong class name captured for replacements

It seems that the class name of the action rather than the class name of where the action was taken is recorded:

 33 | 2020-06-11 12:54:50.000000 |       14 | IntelliJGradle | smr.cs.ualberta.libcomp.action.ReplacementAction | 6,5           |               6 |             5 |      46 |

smr.cs.ualberta.libcomp.action.ReplacementAction should be whatever java file or build file the replacement was done in

Make charts in plugin interactive

Currently:

  • chart is shown as a png (quality is decent but not great)

Goal:

  • better quality image -- so text is more clear
  • display the charts as interactive .svg's as they are shown in the website (so user will be able to interact w/ the charts)

Fix charts displayed in plugin

I noticed that a lot of charts were missing in the SMR DB so I have updated those, now all of the images found in https://github.com/ualberta-smr/librarycomparisonswebsite/tree/master/charts are also in the SMR DB and are properly labelled.

I have kept this script and will add it to my new PR coming soon so that we can keep it for future use when we need to upload new charts to the DB (it converts to png, labels the images with the name Chart-domainID_metricID and then uploads into the DB with the proper domain and metric ID labels.

I noticed also that there were some issues on my part for how I am displaying the images in the dialogue. The problem is that some images are being mapped incorrectly due to the ID changes that occurred when we switched to using API's, I will need to re-map images to the dialogue and fix this.

Also, some images are simply non-existent for particular domain-metric pairs. As of now, these charts/images, if missing, cause the button to be disabled so if you click the chart button for a chart that does not exist nothing happens. I think a better thing to do would be to have either a "default image" or even a message with something like "we do not have a chart to display information for this domain/metric at this time".

Sync LibComp to server DB

Have LibComp pull the updated data every month.
Also need to put the feedback data on a server?

Users will have a local copy of the database on the DB, but it will sync up with the server DB with updated data every month.

Plugin incompatible with IntellIJ IDEA 2020.2

The plugin cannot be installed in the lastest IntelliJ IDEA (Ultimate Edition).

As explained in the readme, Library_Comparison-1.0.2020.zip file is not available in the repository, so I tried Library_Comparison-1.0.11.zip instead!

System Information

image

Steps to replicate:
  • basically followed the same steps mentioned in the Readme file. After clicking on "Install plugin from Disk" and selecting the downloaded zip file (Library_Comparison-1.0.11.zip), plugin import fails with the error message of incompatibility issue (see screenshot below).
Screenshot of error:

image

Update Repo Instructions

Create/update this repository with a set of comprehensive instructions regarding:
What is LibComp?
How to install LibComp?
How to use LibComp?

Dependencies in maven not being recognized

I'm not sure if this has something to do with the color mode again, but when I switched to light mode, now the maven dependencies aren't being highlighted (testng should be highlighted):

image

I can right click and get the library comparisons without a problem, but there's no highlighting.

Also, in maven, it seems that I can right click on any dependency whether we have info about it or not and see the Library comparison option. However, if I choose that option, nothing happens.

Enhance graphical user interface

Make more aesthetic
look at existing plugins to suggest alternate designs
looking into including images of trend graphs which we can possibly take from the library comparison website

Finalize Paper

As I work on enhancements to LibComp, stay on track and continue to update the paper after each task.

Working on paper will take longer for the user study as I will have to analyze the data and re-write the entire section so I set up some time specifically for this task.

Goal: A good publishable paper for a tool tract.

More meaningful presentation of metrics

Check how the metrics are presented on the website and try to mimic as much as possible, given the limited space. For example, saying "25 changes" for backwards compatibility is not clear. Maybe avg 25 breaking changes/release? Check for all metrics

Intsallable plugin should work on older versions

Plugin is packaged a an intelliJ 2020 version plugin, so it seems to be incompatible with 2019 (or previous) versions.

Look into a solution so that the plugin works for multiple version of intelliJ

Data collection optimization

Look into optimizing the way we collect data for the library comparison website (esp. popularity)

First do popularity, but if time permits, look into other metric data collection that could use some optimization.

PROBLEM:

  • Also, apparently there is an issue in that when the popularity script is run, it will collect up to ~720 repo's and then stop. Look into this problem and see whether optimization will fix it.
  • Could it be that github is limiting the amount of data we are allowed to query in a set time period?

Highlighting stays there even if import is changed

1- Try adding an import statement we have info about e.g., import org.junit.*
2- make sure it gets highlighted
3- change that import statement to anything else e.g., import javax.accessibility.Accessible;, the line will remain highlighted which it shouldn't be

image

Release an installable plugin

Look into the criteria needed to release an installable plugin.
Is there an application? Find and fill if yes.
Look into the timeline for this, how long does it take for it to become an installable plugin?

Trigger LibComp on save file and file open

Current functionality of LibComp:

  • on project load, all open editors are analyzed and all .java or build.gradle file(s) with relevant libraries will be highlighted accordingly

  • AFTER project has already loaded, if the user opens a new file in the project and wishes to have LibComp analyze it then have to (1) open the file and then (2) right click with their mouse/mousepad

GOAL/WHAT THIS ISSUE IS FOR:

  • instead of the right click triggering the action for new files opened, make it so the action is triggered on file opened

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.