2 * Copyright 2016 Alexandre Terrasa <alexandre@moz-code.org>.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 .module('metrics', ['model'])
21 .directive('metricsList', function() {
28 listMetricsNames
: '=',
29 listMetricsDefault
: '='
31 templateUrl
: '/directives/metrics/metrics_list.html'
35 .directive('chartModuleDefinitionsKind', function() {
42 templateUrl
: '/directives/metrics/chart_properties.html',
43 link
: function ($scope
, element
, attrs
) {
44 $scope
.loadChart
= function() {
45 if($scope
.chart
) { return; }
46 $scope
.chart
= new d3pie($scope
.chartId
, {
57 "titleSubtitlePadding": 9
62 "pieOuterRadius": "80%"
65 "sortOrder": "value-asc",
68 "label": "Concrete classes",
69 "value": $scope
.chartMetrics
.mnbcc
.avg
,
73 "label": "Abstract classes",
74 "value": $scope
.chartMetrics
.mnbac
.avg
,
78 "label": "Interfaces",
79 "value": $scope
.chartMetrics
.mnbic
.avg
,
86 "format": "label-value2",
90 "hideWhenLessThanPercentage": 3
114 $scope
.$
watch('chartMetrics', function(nv
, ov
) {
116 setTimeout($scope
.loadChart
, 100);
123 .directive('chartModuleDefinitionsInh', function() {
130 templateUrl
: '/directives/metrics/chart_properties.html',
131 link
: function ($scope
, element
, attrs
) {
132 $scope
.loadChart
= function() {
133 if($scope
.chart
) { return; }
134 $scope
.chart
= new d3pie($scope
.chartId
, {
145 "titleSubtitlePadding": 9
150 "pieOuterRadius": "80%"
153 "sortOrder": "value-asc",
156 "label": "Inherited",
157 "value": $scope
.chartMetrics
.mnbd
.avg
- $scope
.chartMetrics
.mnbr
.avg
- $scope
.chartMetrics
.mnbi
.avg
,
161 "label": "Introduced",
162 "value": $scope
.chartMetrics
.mnbi
.avg
,
166 "label": "Redefined",
167 "value": $scope
.chartMetrics
.mnbr
.avg
,
174 "format": "label-value2",
178 "hideWhenLessThanPercentage": 3
202 $scope
.$
watch('chartMetrics', function(nv
, ov
) {
204 setTimeout($scope
.loadChart
, 100);
211 .directive('chartClassPropertiesInh', function() {
218 templateUrl
: '/directives/metrics/chart_properties.html',
219 link
: function ($scope
, element
, attrs
) {
220 $scope
.loadChart
= function() {
221 if($scope
.chart
) { return; }
222 $scope
.chart
= new d3pie($scope
.chartId
, {
233 "titleSubtitlePadding": 9
238 "pieOuterRadius": "80%"
241 "sortOrder": "value-asc",
244 "label": "Inherited",
245 "value": $scope
.chartMetrics
.cnbhp
.avg
- $scope
.chartMetrics
.cnbrp
.avg
,
249 "label": "Introduced",
250 "value": $scope
.chartMetrics
.cnbip
.avg
,
254 "label": "Redefined",
255 "value": $scope
.chartMetrics
.cnbrp
.avg
,
262 "format": "label-value2",
266 "hideWhenLessThanPercentage": 3
290 $scope
.$
watch('chartMetrics', function(nv
, ov
) {
292 setTimeout($scope
.loadChart
, 100);
299 .directive('chartClassPropertiesKind', function() {
306 templateUrl
: '/directives/metrics/chart_properties.html',
307 link
: function ($scope
, element
, attrs
) {
308 $scope
.loadChart
= function() {
309 if($scope
.chart
) { return; }
310 $scope
.chart
= new d3pie($scope
.chartId
, {
321 "titleSubtitlePadding": 9
326 "pieOuterRadius": "80%"
329 "sortOrder": "value-asc",
332 "label": "Attributes",
333 "value": $scope
.chartMetrics
.cnba
.avg
,
338 "value": $scope
.chartMetrics
.cnbm
.avg
- $scope
.chartMetrics
.cnbi
.avg
,
342 "label": "Constructors",
343 "value": $scope
.chartMetrics
.cnbi
.avg
,
347 "label": "Virtual Types",
348 "value": $scope
.chartMetrics
.cnbv
.avg
,
355 "format": "label-value2",
359 "hideWhenLessThanPercentage": 3
383 $scope
.$
watch('chartMetrics', function(nv
, ov
) {
385 setTimeout($scope
.loadChart
, 100);
392 .directive('chartClassInheritanceKind', function() {
399 templateUrl
: '/directives/metrics/chart_properties.html',
400 link
: function ($scope
, element
, attrs
) {
401 $scope
.loadChart
= function() {
402 if($scope
.chart
) { return; }
403 $scope
.chart
= new d3pie($scope
.chartId
, {
414 "titleSubtitlePadding": 9
419 "pieOuterRadius": "80%"
422 "sortOrder": "value-asc",
425 "label": "Interfaces",
426 "value": $scope
.chartMetrics
.cnoai
.avg
,
430 "label": "Abstract classes",
431 "value": $scope
.chartMetrics
.cnoaa
.avg
,
435 "label": "Concrete classes",
436 "value": $scope
.chartMetrics
.cnoac
.avg
- $scope
.chartMetrics
.cnoaa
.avg
,
443 "format": "label-value2",
447 "hideWhenLessThanPercentage": 3
471 $scope
.$
watch('chartMetrics', function(nv
, ov
) {
473 setTimeout($scope
.loadChart
, 100);