Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language: node_js
node_js:
- "4"
- "5"
- "6"
- "10"
before_script:
- npm install -g grunt-cli
- mkdir ~/bin
- mkdir -p ~/bin
- export PATH=~/bin:$PATH
- npm install

Expand Down
5 changes: 3 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-casper');
// grunt.loadNpmTasks('grunt-casper');

grunt.registerTask('runtest',function(){
var done = this.async();
Expand Down Expand Up @@ -136,7 +136,8 @@ module.exports = function(grunt) {

grunt.registerTask('optimize', ['uglify']);
// Default task.
grunt.registerTask('test', ['jshint', 'nodeunit', 'runtest', 'runbin', 'casper']);
//grunt.registerTask('test', ['jshint', 'nodeunit', 'runtest', 'runbin', 'casper']);
grunt.registerTask('test', ['jshint', 'nodeunit', 'runtest', 'runbin']);
grunt.registerTask('default', ['test']);

};
8 changes: 4 additions & 4 deletions lib/assets/scripts/plato-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ $(function(){
reports.forEach(function(report){

// @todo shouldn't need this, 'auto [num]' doesn't seem to work : https://github.com/oesmith/morris.js/issues/201
sloc.ymax = Math.max(sloc.ymax, report.complexity.methodAggregate.sloc.physical);
bugs.ymax = Math.max(bugs.ymax, report.complexity.methodAggregate.halstead.bugs.toFixed(2));
sloc.ymax = Math.max(sloc.ymax, report.complexity.aggregate.sloc.physical);
bugs.ymax = Math.max(bugs.ymax, report.complexity.aggregate.halstead.bugs.toFixed(2));


sloc.data.push({
value : report.complexity.methodAggregate.sloc.physical,
value : report.complexity.aggregate.sloc.physical,
label : report.info.fileShort
});
bugs.data.push({
value : report.complexity.methodAggregate.halstead.bugs.toFixed(2),
value : report.complexity.aggregate.halstead.bugs.toFixed(2),
label : report.info.fileShort
});
maintainability.data.push({
Expand Down
8 changes: 4 additions & 4 deletions lib/models/FileHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ FileHistory.prototype.addReport = function(report, date) {
date = date || report.date || new Date().toUTCString();
this.push({
date : date,
sloc : report.complexity.methodAggregate.sloc.physical,
lloc : report.complexity.methodAggregate.sloc.logical,
sloc : report.complexity.aggregate.sloc.physical,
lloc : report.complexity.aggregate.sloc.logical,
functions : report.complexity.methods.length,
deliveredBugs : report.complexity.methodAggregate.halstead.bugs,
difficulty: report.complexity.methodAggregate.halstead.difficulty,
deliveredBugs : report.complexity.aggregate.halstead.bugs,
difficulty: report.complexity.aggregate.halstead.difficulty,
maintainability: report.complexity.maintainability,
lintErrors : (report.jshint && report.jshint.messages.length) || []
});
Expand Down
6 changes: 3 additions & 3 deletions lib/plato.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ exports.getOverviewReport = function (reports) {

reports.forEach(function(report) {
// clone objects so we don't have to worry about side effects
summary.total.sloc += report.complexity.methodAggregate.sloc.physical;
summary.total.sloc += report.complexity.aggregate.sloc.physical;
summary.total.maintainability += report.complexity.maintainability;

var methodAggregate = _.cloneDeep(report.complexity.methodAggregate);
var aggregate = _.cloneDeep(report.complexity.aggregate);
var reportItem = {};
reportItem.info = report.info;
if (report.jshint) {
Expand All @@ -209,7 +209,7 @@ exports.getOverviewReport = function (reports) {
}
if (report.complexity) {
reportItem.complexity = {
methodAggregate : methodAggregate,
aggregate : aggregate,
module : report.complexity.module,
module_safe : report.complexity.module_safe,
maintainability : _.cloneDeep(report.complexity.maintainability)
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ <h2 class="reportTitle">Worst Maintainability Scores</h2>
<div class="reportBlock locList">
<h2 class="reportTitle">Largest Files</h2>
<ul class="list-unstyled">
<% _.each(_.take(_.sortBy(report.reports, function (report) { return -1 * report.complexity.methodAggregate.sloc.physical }), 5), function(report, i) { %>
<% _.each(_.take(_.sortBy(report.reports, function (report) { return -1 * report.complexity.aggregate.sloc.physical }), 5), function(report, i) { %>
<li>
<strong><%= report.complexity.methodAggregate.sloc.physical %> lines</strong>
<strong><%= report.complexity.aggregate.sloc.physical %> lines</strong>
<small><%= report.info.fileShort %></small>
</li>
<% }); %>
Expand Down
6 changes: 3 additions & 3 deletions lib/templates/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis
</div>
<div class="col-md-6">
<h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC" data-container="body"></i></h2>
<p class="stat"><%= report.complexity.methodAggregate.sloc.physical %></p>
<p class="stat"><%= report.complexity.aggregate.sloc.physical %></p>
</div>
</div>
<div class="row historical">
Expand All @@ -62,11 +62,11 @@ <h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" da
<div class="row">
<div class="col-md-6">
<h2 class="header">Difficulty <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty" data-container="body"></i></a></h2>
<p class="stat"><%= report.complexity.methodAggregate.halstead.difficulty.toFixed(2) %></p>
<p class="stat"><%= report.complexity.aggregate.halstead.difficulty.toFixed(2) %></p>
</div>
<div class="col-md-6">
<h2 class="header">Estimated Errors <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs" data-container="body"></i></a></h2>
<p class="stat"><%= report.complexity.methodAggregate.halstead.bugs.toFixed(2) %></p>
<p class="stat"><%= report.complexity.aggregate.halstead.bugs.toFixed(2) %></p>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions lib/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ <h1 class="col-md-12">Files</h1>
<span class="col-md-4 file"><a class="file-link" href="./<%= item.info.link %>"><%= item.info.fileShort %></a></span>
<span class="col-md-8 file-chart js-file-chart"
data-lint="<%= item.jshint && item.jshint.messages %>"
data-sloc="<%= item.complexity.methodAggregate.sloc.physical %>"
data-bugs="<%= item.complexity.methodAggregate.halstead.bugs.toFixed(2) %>"
data-complexity="<%= item.complexity.methodAggregate.cyclomatic%>"
data-sloc="<%= item.complexity.aggregate.sloc.physical %>"
data-bugs="<%= item.complexity.aggregate.halstead.bugs.toFixed(2) %>"
data-complexity="<%= item.complexity.aggregate.cyclomatic%>"
></span>
</div>
</li>
Expand Down
Loading