forked from es-analysis/plato
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial support for collation and archival of report data
- Loading branch information
Jarrod Overson
committed
Mar 19, 2013
1 parent
2e5f43a
commit 189d7e2
Showing
72 changed files
with
836 additions
and
6,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
tmp | ||
node_module | ||
node_modules | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
'use strict'; | ||
|
||
var History = require('./History'); | ||
|
||
module.exports = FileHistory; | ||
|
||
function FileHistory(data) { | ||
History.call(this, data); | ||
} | ||
|
||
FileHistory.prototype = Object.create(History.prototype); | ||
|
||
|
||
FileHistory.prototype.addReport = function(report) { | ||
var date = report.date || new Date().toUTCString(); | ||
this.push({ | ||
date : date, | ||
sloc : report.complexity.aggregate.complexity.sloc.physical, | ||
lloc : report.complexity.aggregate.complexity.sloc.logical, | ||
functions : report.complexity.functions.length, | ||
deliveredBugs : report.complexity.aggregate.complexity.halstead.bugs, | ||
maintainability: report.maintainability, | ||
lintErrors : report.jshint.messages.length, | ||
difficulty: report.complexity.aggregate.complexity.halstead.difficulty | ||
}); | ||
return this; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
'use strict'; | ||
|
||
var _ = require('lodash'); | ||
|
||
module.exports = History; | ||
|
||
function History(data) { | ||
this.length = 0; | ||
if (data && data.length) { | ||
// using lodash to catch array-like objects | ||
_.each(data, function(record, index){ | ||
this[index] = _.cloneDeep(record); | ||
}.bind(this)); | ||
this.length = data.length; | ||
} | ||
} | ||
|
||
History.prototype.push = function(obj) { | ||
this[this.length] = obj; | ||
this.length++; | ||
}; | ||
|
||
History.prototype.toJSON = function() { | ||
var obj = []; | ||
_.each(this, function(val,index){ | ||
obj[index] = _.cloneDeep(val); | ||
}.bind(this)); | ||
return obj; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
'use strict'; | ||
|
||
// local lib | ||
var History = require('./History'); | ||
|
||
module.exports = OverviewHistory; | ||
|
||
function OverviewHistory(data) { | ||
History.call(this, data); | ||
} | ||
|
||
OverviewHistory.prototype = Object.create(History.prototype); | ||
|
||
OverviewHistory.prototype.addReport = function(report) { | ||
var date = report.date || new Date().toUTCString(); | ||
this.push({ | ||
date : date, | ||
total : { | ||
sloc : report.summary.total.sloc, | ||
maintainability: report.summary.total.maintainability | ||
}, | ||
average : { | ||
sloc : report.summary.average.sloc, | ||
maintainability: report.summary.average.maintainability | ||
} | ||
}); | ||
return this; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
reports/files/lib_assets_scripts_codemirror_markpopovertext_js/report.history.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
reports/files/lib_assets_scripts_codemirror_markpopovertext_js/report.history.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"date":"Tue, 19 Mar 2013 06:13:22 GMT","sloc":75,"lloc":54,"functions":7,"deliveredBugs":0.7123483448963878,"lintErrors":0,"difficulty":23.684523809523807},{"date":"Tue, 19 Mar 2013 06:13:34 GMT","sloc":75,"lloc":54,"functions":7,"deliveredBugs":0.7123483448963878,"lintErrors":0,"difficulty":23.684523809523807},{"date":"Tue, 19 Mar 2013 06:16:59 GMT","sloc":75,"lloc":54,"functions":7,"deliveredBugs":0.7123483448963878,"lintErrors":0,"difficulty":23.684523809523807},{"date":"Tue, 19 Mar 2013 06:17:09 GMT","sloc":75,"lloc":54,"functions":7,"deliveredBugs":0.7123483448963878,"lintErrors":0,"difficulty":23.684523809523807}] |
Oops, something went wrong.