Create weighted graph from adjacency matrix

- If the weighted parameter is not set to true then the edge
  list that is produced from the adjacency matrix will just be
  a multiplicity of the matrix value

- When writting the graphs to the dot files the edges also are
  written with a multiplicity instead of a separate weight value
  which just makes enormously redundant files

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Scale edge weight before generating dot files

- Graphviz breaks when the edge weights are extremely high

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Do not bother saving singleton communities

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Abort cluster analysis when off diagonal sum is zero

- It turns out the simple matrix sum based abort will
  not handle the case where all edges are self edges,
  when a matrix only has diagonal elements then the
  analysis fails

- We now compute the off diagonal sum to decide whether
  to abort

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Add check to ensure the revisions list is unique

- The revisions list should be unique values, non-unique values
  cause later failures

- The duplicate revisions occur when a project has been very
  inactive and thus has no commits between two different analysis
  windows

- We now check to make sure the windows do not overlap in terms
  of commits

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Add default for global graph query

- There actually should not be a need to indicate a cluster
  method since global graphs have no method applied to them

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Ping mysql server and reconnect if timeout occured

- Currently the mysql connection is made immediately and then
  the scrapping of the VCS starts

- If the scraping takes a long time then a timeout can
  occur for exampe in very large projects like mozilla

- When the timeout occurs then the analysis fails once the
  scraping is done and attempts are made to write data to the db

- We now ping the server before we make any query and make a
  reconnection attempt if a time out has occured

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>
Check if database file is already in the directory

- Avoid recreating the database file if it is already present
  this part of the analysis can be very time consuming

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@siemens.com>