Skip to content

Perform various operations on the Bill source code, mostly for analysical purposes.

License

Notifications You must be signed in to change notification settings

utilitywarehouse/billsourcery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

billsourcery

A tool for analysing the source code of Equinox applications.

Requirements

Installation

go install github.com/utilitywarehouse/billsourcery@latest

Usage

billsourcery --help

Neo4j graph database

If using the neo4j output from billsourcery, you may wish to install and use neo4j.

Neo4J Installation

Download and install Neo4j

For simple local use, disable authentication by setting dbms.security.auth_enabled=false in neo4j.conf

Load analysed bill source code data into neo4j

This may take some time to import (e.g. 10 or 20 minutes)

$ cd && git clone [email protected]:utilitywarehouse/uw-bill-source-history.git
$ billsourcery --source-root=${PATH_TO_BILL_SOURCE} generate-graph --output-type neo | cypher-shell

alternatively, if you also want usage information, first obtain CSVs of the ModuleS and ModuDet tables from Bill using eqdb-loader, and then use :

$ billsourcery --source-root=${PATH_TO_BILL_SOURCE} generate-graph --output-type neo --modules-csv /path/to/ModuleS.csv --modudet-csv /path/to/ModuDet.csv  | cypher-shell

Visualise graph data (example queries)

Navigate to http://localhost:7474/

Find missing nodes that are referenced from elsewhere:

`MATCH (n:Missing) return n`

Find nodes containing the name "customer":

`MATCH (n:Node) where n.name CONTAINS 'customer' return n`

Find methods that are not called from anywhere:

`MATCH (m:Method) WHERE NOT (m)<-[:references]-() RETURN m.name order by m.name`

Find method nrg_sweep2 and everything it references, recursively. Exclude fields and work areas for clarity:

`MATCH p=(n:Node)-[r:references*]->(x:Node) where lower(n.name)="nrg_sweep2" and not(x:Field) and not(x:WorkArea) RETURN p`

Find table ginv and everything that references it, recursively.

`MATCH p=(n:Node)-[r:references*]->(x:Table) where lower(x.name)="ginv" RETURN p`

Find the most referenced tables:

`MATCH (n)-[references]->(t:Table) RETURN  t.name, count(n) order by count(n) desc limit 20`

About

Perform various operations on the Bill source code, mostly for analysical purposes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •