Post on 28-Oct-2019
by
JavaLand 2017
Dirk Mahler
2
▪ Motivation▪ jQAssistant▪ The Git Graph▪ Demo▪ Q&A
Shadows Of The Past – Analysis Of Git Repositories
3
4
+
Adam Tornhillhttps://pragprog.com/book/atcrime/your-code-as-a-crime-scene
http://codescene.io
Shadows Of The Past – Analysis Of Git Repositories
5
6
http://jQAssistant.org
▪ Open Source: GPLv3
▪ Current release: 1.2.0 initiated: 03/2013 first stable release: 04/2015
▪ Neo4j Community Edition http://neo4j.org embedded, no installation necessary
7
▪ The Idea
Scan software structures
Store in a database
Execute queries▪ Explore
▪ Add high level concepts
▪ Find constraint violations
Create reports
Database
8
Command Line/
Maven
Scan
Analyze
Report
Plugins
Plugins
Plugins
9
▪ Available scanner plugins
▪ Plugin API is public
*.class
RDBMS Schema
GitJaCoCo
FindBugsCheckStyle
LiquibaseJAR, WAR, EARZIP
application.xmlweb.xml
MANIFEST.MF /META-INF/services/*
beans.xml
pom.xml surefire-reports.xml
GZ
*.properties
*.xsd
M2 Repository
*.yaml
10
▪ Getting Started – Maven Project
<build><plugins><plugin>
<groupId>com.buschmais.jqassistant</groupId><artifactId>jqassistant-maven-plugin</artifactId><version>1.x.x</version>
</plugin></plugins>
</build>
▪ mvn install▪ mvn jqassistant:scan▪ mvn jqassistant:server http://localhost:7474
11
▪ The Git Plugin
<plugin><groupId>com.buschmais.jqassistant</groupId><artifactId>jqassistant-maven-plugin</artifactId><version>1.x.x</version><scanIncludes><scanInclude>
<path>${project.basedir}/.git</path></scanInclude>
</scanIncludes><dependency><groupId>de.kontext-e.jqassistant.plugin</groupId><artifactId>jqassistant.plugin.git</artifactId><version>1.1.4</version>
</dependency></plugin>
Shadows Of The Past – Analysis Of Git Repositories
12
13
▪ The Git History Is A Graph!
Commit Commit
HAS_PARENT
Commit
HAS_PARENT
Commit
HAS_PARENT
Commit
HAS_PARENT
Commit
HAS_PARENTHAS_PARENT
Branch
HAS_HEAD
Branch
HAS_HEAD
ON_COMMIT
TagFile
MODIFIES
Change
CONTAINS_CHANGE
Author
COMMITTED COMMITTED
14
▪ Explore Git Using Queries Which author did a commit?
▪ Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
CommitAuthor
COMMITTED
15
▪ Explore Git Using Queries Which author did a commit?
▪ Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
()-[]->()
16
▪ Explore Git Using Queries Which author did a commit?
▪ Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(a)-[]->(c)
ca
17
▪ Explore Git Using Queries Which author did a commit?
▪ Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(a)-[:COMMITTED]->(c)
ca COMMITTED
18
▪ Explore Git Using Queries Which author did a commit?
▪ Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(a:Author)-[:COMMITTED]->(c:Commit)
c
Commit
a
Author
COMMITTED
19
▪ Explore Git Using Queries Which author did a commit?
▪ Pattern matching is the core principle of Cypher
MATCH(a:Author)-[:COMMITTED]->(c:Commit)
RETURNa.name, c.message
c
Commit
a
Author
COMMITTED
Shadows Of The Past – Analysis Of Git Repositories
20
21
▪ DukeCon
https://github.com/DirkMahler/dukecon_server (fork)
Web: jqassistant.org
Twitter: @jqassistant
Google Group: jQAssistant
Stackoverflow Tag: jQAssistant
by