iVis-at-Bilkent / software-artifact-analyzer

SAA: A tool to visually analyze varying software artifacts including source code files, pull requests, issues, and commits, as well as their links and their relationships with developers in a software project to improve the software development process
0 stars 0 forks source link

Code refactoring: Modify the project source code to enable new analysis easily integrated #104

Open LaraMerdol opened 9 months ago

LaraMerdol commented 9 months ago

For easier integration of new analyses into our project, we should restructure the repository to allow other developers to easily integrate their work.

LaraMerdol commented 9 months ago

The new structure of the custom folder:

/src
|-- app
|   |-- custom
|   |   |-- analyses
|   |   |-- assets
|   |   |-- customization-service
|   |   |-- config
|   |   |-- database-tab
|   |   |-- map-tab
|   |   |-- object-tab
|   |   |-- customization.module.ts

Developers should add each component to the customization.module.ts after adding them.

LaraMerdol commented 9 months ago

For the analysis components inside the analyses folder collect the helper methods that are same for the each query component to one file called query-helper.ts

LaraMerdol commented 9 months ago

Developer guide for the developers; https://docs.google.com/document/d/1dIasoHNoGYy6klZOnmUMzOE7RvM-fN7DOcEf7w9jS70/edit?usp=sharing

LaraMerdol commented 9 months ago

Adding query component interface and modifying all analysis components as they implement that interface.

import { TableViewInput, TableFiltering, TableData } from '../../shared/table-view/table-view-types';
import { Subject } from 'rxjs';
import { GraphResponse } from 'src/app/visuall/db-service/data-types';

export interface QueryComponent<T>  {
  tableInput: TableViewInput;
  tableFilled: Subject<boolean>;
  tableResponse: T; 
  graphResponse: GraphResponse;
  clearTableFilter: Subject<boolean>;

  ngOnInit(): void;
  prepareQuery(): void;
  loadTable(skip: number, filter?: TableFiltering): void;
  loadGraph(skip: number, filter?: TableFiltering): void;
  filterGraphResponse(x: GraphResponse): GraphResponse;
  fillTable(data: T[], totalDataCount: number | null): void;
  getDataForQueryResult(e: any): void;
  filterTable(filter: TableFiltering): void;
  filterTableResponse(x: T[], filter: TableFiltering): T[];
}
LaraMerdol commented 9 months ago

The structure of the custom folder changed as;

/src
|-- app
|   |-- custom
|   |   |-- analyses
|   |   |-- customization-service
|   |   |-- config
|   |   |-- operational-tabs
|   |   |-- customization.module.ts