Commit c203ffe7 authored by Pierre-Yves Gibello's avatar Pierre-Yves Gibello
Browse files

Unanswered bugs now a ratio, not a raw count

parent 492de309
Pipeline #18532 passed with stages
in 1 minute and 13 seconds
......@@ -32,7 +32,7 @@ public class GithubHandler extends JsonDataHandler {
String lastKey;
String iid;
String state;
int unansweredBugs;
int unansweredBugs, totalBugs;
double timeIntervalCount = 0, updateTimeCount = 0;
double avgOpenTime = -1D, avgUpdateTime = -1D;
boolean assignee = false;
......@@ -112,6 +112,7 @@ public class GithubHandler extends JsonDataHandler {
} else if("state".equals(this.lastKey)) {
this.state = val.trim();
} else if("comments".equals(this.lastKey) && "open".equals(this.state)) {
this.totalBugs ++;
// Unanswered bug = open, no comment
try {
if(Integer.parseInt(val.trim()) <= 0) this.unansweredBugs ++;
......@@ -122,13 +123,29 @@ public class GithubHandler extends JsonDataHandler {
}
/**
* Retrieves unanswered bugs count
* Retrieves unanswered bugs ratio
* Unanswered bugs are open bugs with no comment
* @return unanswered bugs count
* @return unanswered bugs ratio
*/
public int getUnansweredBugs() {
return (int) Math.round(100 * ((double)this.unansweredBugs / (double)this.totalBugs));
}
/**
* Retrieves unanswered bugs count
* @return unanswered bugs count
*/
public int getUnansweredBugsCount() {
return this.unansweredBugs;
}
/**
* Retrieves all bugs count
* @return bugs count
*/
public int getBugsCount() {
return this.totalBugs;
}
/**
* Retrieves average bug open time
......@@ -181,7 +198,7 @@ public class GithubHandler extends JsonDataHandler {
handler.run();
System.out.println("Finished: " + new java.util.Date());
if(handler.isDone()) {
System.out.println("Unanswered bugs=" + handler.getUnansweredBugs());
System.out.println("Unanswered bugs ratio=" + handler.getUnansweredBugs() + " = (" + handler.getUnansweredBugsCount() + "/" + handler.getBugsCount() + ")");
System.out.println("Average bug open time=" + handler.getBugOpenTime());
System.out.println("Bug tracker active users=" + handler.getBugTrackerActiveUsers().size());
System.out.println("Average response time=" + handler.getBugResponseTime());
......
......@@ -35,7 +35,7 @@ public class GitlabHandler extends JsonDataHandler {
String lastKey;
String iid;
String state;
int unansweredBugs;
int unansweredBugs, totalBugs;
double timeIntervalCount = 0, updateTimeCount = 0;
double avgOpenTime = -1D, avgUpdateTime = -1D;
boolean assignee = false;
......@@ -116,6 +116,7 @@ public class GitlabHandler extends JsonDataHandler {
} else if("state".equals(this.lastKey)) {
if(this.state == null) this.state = val.trim(); // there are other "state" in embedded objects
} else if("user_notes_count".equals(this.lastKey)) {
this.totalBugs ++;
// Unanswered bug = open, no comment
if("opened".equals(this.state)) {
try {
......@@ -128,13 +129,29 @@ public class GitlabHandler extends JsonDataHandler {
}
/**
* Retrieves unanswered bugs count
* Retrieves unanswered bugs ratio
* Unanswered bugs are open bugs with no comment
* @return unanswered bugs count
* @return unanswered bugs ratio
*/
public int getUnansweredBugs() {
return (int) Math.round(100 * ((double)this.unansweredBugs / (double)this.totalBugs));
}
/**
* Retrieves unanswered bugs count
* @return unanswered bugs count
*/
public int getUnansweredBugsCount() {
return this.unansweredBugs;
}
/**
* Retrieves all bugs count
* @return bugs count
*/
public int getBugsCount() {
return this.totalBugs;
}
/**
* Retrieves average bug open time
......@@ -187,7 +204,7 @@ public class GitlabHandler extends JsonDataHandler {
handler.run();
System.out.println("Finished: " + new java.util.Date());
if(handler.isDone()) {
System.out.println("Unanswered bugs=" + handler.getUnansweredBugs());
System.out.println("Unanswered bugs ratio=" + handler.getUnansweredBugs() + " = (" + handler.getUnansweredBugsCount() + "/" + handler.getBugsCount() + ")");
System.out.println("Average bug open time=" + handler.getBugOpenTime());
System.out.println("Bug tracker active users=" + handler.getBugTrackerActiveUsers().size());
System.out.println("Average response time=" + handler.getBugResponseTime());
......
......@@ -34,7 +34,7 @@ import org.ow2.mrl.data.collect.JsonDataHandler;
public class JiraHandler extends JsonDataHandler {
int level = 0, issueLevel = 0;
int unansweredBugs = -1;
int unansweredBugs = -1, totalBugs;
boolean inStatQueries = true;
LocalDateTime rDate, cDate, uDate;
String lastKey;
......@@ -123,7 +123,7 @@ public class JiraHandler extends JsonDataHandler {
stat = 0;
}
if(this.unansweredBugs < 0) {
this.unansweredBugs = stat; // Should be all bugs (1st query)
this.unansweredBugs = this.totalBugs = stat; // Should be all open bugs (1st query)
} else {
this.unansweredBugs -= stat; // Substract commented bugs (2nd query)
}
......@@ -131,13 +131,29 @@ public class JiraHandler extends JsonDataHandler {
}
/**
* Retrieves unanswered bugs count
* Retrieves unanswered bugs ratio
* Unanswered bugs are open bugs with no comment
* @return unanswered bugs count
* @return unanswered bugs ratio
*/
public int getUnansweredBugs() {
return (int) Math.round(100 * ((double)this.unansweredBugs / (double)this.totalBugs));
}
/**
* Retrieves unanswered bugs count
* @return unanswered bugs count
*/
public int getUnansweredBugsCount() {
return this.unansweredBugs;
}
/**
* Retrieves all bugs count
* @return bugs count
*/
public int getBugsCount() {
return this.totalBugs;
}
/**
* Retrieves average bug open time
......@@ -190,7 +206,7 @@ public class JiraHandler extends JsonDataHandler {
handler.run();
System.out.println("Finished: " + new java.util.Date());
if(handler.isDone()) {
System.out.println("Unanswered bugs=" + handler.getUnansweredBugs());
System.out.println("Unanswered bugs ratio=" + handler.getUnansweredBugs() + " = (" + handler.getUnansweredBugsCount() + "/" + handler.getBugsCount() + ")");
System.out.println("Average bug open time=" + handler.getBugOpenTime());
System.out.println("Average bug response time=" + handler.getBugResponseTime());
System.out.println("Bug tracker active users=" + handler.getBugTrackerActiveUsers().size());
......
......@@ -21,7 +21,9 @@ class GithubHandlerTest {
assertEquals(16.4, handler.getBugOpenTime());
assertEquals(37956, handler.getBugResponseTime());
assertEquals(8, handler.getBugTrackerActiveUsers().size());
assertEquals(3, handler.getUnansweredBugs());
assertEquals(3, handler.getUnansweredBugsCount());
assertEquals(4, handler.getBugsCount());
assertEquals(75, handler.getUnansweredBugs()); // unanswered bugs ratio
} catch(Exception e) {
e.printStackTrace();
}
......
......@@ -21,7 +21,9 @@ class GitlabHandlerTest {
assertEquals(2171, handler.getBugOpenTime());
assertEquals(5128339, handler.getBugResponseTime());
assertEquals(5, handler.getBugTrackerActiveUsers().size());
assertEquals(2, handler.getUnansweredBugs());
assertEquals(2, handler.getUnansweredBugsCount());
assertEquals(13, handler.getBugsCount());
assertEquals(15, handler.getUnansweredBugs()); // unanswered bugs ratio
} catch(Exception e) {
e.printStackTrace();
}
......
......@@ -21,7 +21,9 @@ class JiraHandlerTest {
assertEquals(24.29, round2(handler.getBugOpenTime()));
assertEquals(256219.77, round2(handler.getBugResponseTime()));
assertEquals(8, handler.getBugTrackerActiveUsers().size());
assertEquals(33, handler.getUnansweredBugs());
assertEquals(33, handler.getUnansweredBugsCount());
assertEquals(48, handler.getBugsCount());
assertEquals(69, handler.getUnansweredBugs()); // unanswered bugs ratio
} catch(Exception e) {
e.printStackTrace();
}
......
......@@ -2,7 +2,7 @@
MRL.thresholds: https://projects.ow2.org/get/ow2/Project_metrics_thresholds
# Scanned projects list
projects: asm, authzforce, clif, docdoku, fusiondirectory, glpi, imixs-workflow, jeka, joram, knowage, lemonldap-ng, lutece, ocsinventory, proactive, rocket-chat, sat4j, seedstack, sympa, spoon, telosys, waarp, weblab, xwiki, zenroom
projects: asm, authzforce, bluemind, clif, docdoku, fusiondirectory, glpi, imixs-workflow, jeka, joram, knowage, lemonldap-ng, lutece, ocsinventory, proactive, rocket-chat, sat4j, seedstack, sympa, spoon, telosys, waarp, weblab, xwiki, zenroom
# Output directory for data collection (script and data)
outputDir: /tmp/MRL
......@@ -30,6 +30,17 @@ authzforce.scancode: https://gitlab.ow2.org/ow2/oscar/authzforce/-/jobs/artifact
authzforce.omm: https://projects.ow2.org/rest/wikis/projects/spaces/authzforce/pages/omm3/objects/ow2.Omm3/0/properties
authzforce.mkt: https://projects.ow2.org/rest/wikis/projects/spaces/authzforce/pages/MKTForm/objects/ow2.MKTFormClass/0/properties
#BlueMind
bluemind.repo: https://forge.bluemind.net/stash/projects/BM/repos/bluemind-public
bluemind.issues.endpoint: https://forge.bluemind.net/jira/rest/api/2/search
bluemind.issues.credentials: user:password
bluemind.issues.project: BM
bluemind.sonarqube.server: https://forge.bluemind.net/sonar
bluemind.sonarqube: BlueMind
##bluemind.scancode:
bluemind.omm: https://projects.ow2.org/rest/wikis/projects/spaces/bluemind/pages/omm3/objects/ow2.Omm3/0/properties
bluemind.mkt: https://projects.ow2.org/rest/wikis/projects/spaces/bluemind/pages/MKTForm/objects/ow2.MKTFormClass/0/properties
# Clif (complete)
clif.repo: https://gitlab.ow2.org/clif/clif-legacy
clif.issues.endpoint: https://gitlab.ow2.org/api/v4/projects
......
......@@ -51,7 +51,8 @@ SPDX-License-Identifier: Apache-2.0
<servlet.version>3.1.0</servlet.version>
<maria.db.jdbc.driver.version>2.7.3</maria.db.jdbc.driver.version>
<junit.version>5.7.2</junit.version>
<icar.json.version>1.0.0</icar.json.version>
<!--icar.json.version>1.0.0</icar.json.version-->
<icar.json.version>1.0.1</icar.json.version>
<slf4j.version>1.7.32</slf4j.version>
<logback.classic.version>1.2.4</logback.classic.version>
<!-- Maven plugins version -->
......@@ -69,7 +70,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin.versions.version>2.8.1</plugin.versions.version>
<plugin.maven.site.version>3.9.1</plugin.maven.site.version>
<maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version>
<maven.version>3.8.3</maven.version>
<maven.version>3.6.3</maven.version>
</properties>
<dependencyManagement>
......@@ -188,7 +189,7 @@ SPDX-License-Identifier: Apache-2.0
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.version}</version>
<version>[${maven.version},)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[11.0,11.99999)</version>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment