Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

fadnincx/comment-analysis-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comment Analysis Connector

This project allows to analyze and visualize class-comments here in Github. It was build as a seminar project for the Software Composition Seminar at the University of Bern and serves as a proof of concept.

Overview

1. Reqirements
2. Installation
3. Getting started / Usage
4. Repo Structure
5. References
6. License

Requirements

  • Chrome browser (tested with version 96.0)
  • Java (>= 17) with Maven (>=3.8.1) or Docker (tested with 20.10.7)

Installation

Comment-analysis-neon API

  1. To install the Comment-analysis-neon API, you first need to compile Maenu's Comment-Analysis-Neon Repo with mvn package
    The reason is, that the outputted jar file is too big for the common maven package hosters.
  2. If the generation failes on the tests, your platform somehow doesn't behave as expected and you might try to run everything in a docker container or simply use the provided docker-compose file.
  3. Copy the generated target/comment-analysis-neon-0.0.2-SNAPSHOT.jar file to /api/lib/comment-analysis-neon.jar
  4. Now the api directory is a standard Maven project you can either run directly using the Maven tools or compile it to a jar, to then run the Comment-analysis-neon API without Maven.

Comment-analysis-neon Chrome-Plugin

  1. Go to chrome://extensions/ and enable the developer-mode in the top right corner
  2. Now click on "Load unpacked" and just go to your local clone of this repo and select the chrome-plugin directory
  3. Now, in the extension list of Chrome, near the URL field, when clicking on the icon a small window should appear in which you can first enable and disable this plugin and secondly, you can configure the address at which the API can be reached.

Getting started / Usage

The usage is relatively simple. After the installation of both parts see here, if the Comment-analysis-neon API is running and configured in the plugin (only necessary if you change the default), and you enabled the plugin in the configuration window, just browse to any Java, Python or Pharo repository on Github and you should see a result. Just as an example:

If the plugin is activated, a small colored triangle appears in the top right corner. This can be disabled in chrome-plugin/content.js on line 24 const cornerEnable = false. There you can also change its colors. The default color are

  • There has been done nothing. Either there is no appropriate code on this page, or we still wait for a response from the API
  • The source code has been successfully analyzed
  • The page is not analyzed due to an error in the communication with the Comment-analysis-neon API. Ensure the API is running and configured in the plugin as described here.

For example:

Once the corner turned into green, you can see the class comments underlined. Hovering at any location inside comments, a tooltip appears on the hovered line with a label.

The label indicates the assigned category (intent) of the sentence. In order to see all occurrences of a specific label inside comments, a small overlay is added on the right upper side of the page (movable). Hovering over a label should display all its occurrences in the text.

Repo Structure

We also provide a docker and docker-compose file to run the Comment-analysis-neon API in a docker container, as we experienced some systems don't behave as expected when running the analysis algorithm in the comment-analysis-neon-packet.

The folder is, where our REST-API is defined.

This folder is, where the entire Chrome plugin is defined.

  • background.js
    This file contains the background service handler, doing everything that not be done on the page in the content.js
  • config.js
    Is the javascript file needed in index.html, the plugin configuration window
  • content.js
    This is the main file. It gets added to the scripts, when you browse github.com and does all the DOM handling there. In the top part, there are some styling and configuration possibilities, to adjust the appearance to your preferences.
  • index.html
    Describes the small window for the plugin configuration.
  • manifest.json
    The manifest describing the plugin and some meta data to Chrome, defines the active pages, request additional permissions and so on.

References

License

GNU General Public License v3.0 or later See LICENSE to see the full text.

About

SCG Comment Analysis Connector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published