Showing 27 of 143 total issues
File kibana.js
has 610 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File activity.js
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function getTempleateVisualizations
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.getTempleateVisualizations = function () {
if ($scope.game && $scope.version) {
$http.get(CONSTANTS.PROXY + '/kibana/templates/index/' + $scope.game._id)
.success(function (data) {
File participantsConf.js
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function getStatements
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.getStatements = function () {
$http.get(CONSTANTS.PROXY + '/games/statements').success(function (data) {
var dash = new ADL.XAPIDashboard();
dash.addStatements(data.statements);
Function submitTemplateVisualization
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.submitTemplateVisualization = function () {
$scope.templateVisualization.contents = JSON.parse($scope.templateVisualization.contents);
if ($scope.templateVisualization.contents) {
var isDevVis = $scope.templateVisualization.contents.isDeveloper;
var isTchVis = $scope.templateVisualization.contents.isTeacher;
Function exports
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
// Code adapted from http://stackoverflow.com/a/18402335/15472
grunt.registerTask('default', function () {
Function selectVisualization
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.selectVisualization = function (usr, visualizationId) {
$scope.waitOperation = true;
var checkboxList;
var listVisualizations;
var obj = {};
Function generateTestVisualization
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.generateTestVisualization = function () {
var panels = [];
var uiStates = {};
// Add index
Function exports
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
// Code adapted from http://stackoverflow.com/a/18402335/15472
grunt.registerTask('default', function () {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function addTemplateVisualization
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.addTemplateVisualization = function () {
var visualization = JSON.parse(document.getElementById('exampleVisualization').value);
if (visualization) {
$http.post(CONSTANTS.PROXY + '/kibana/templates/visualization/author/' + $scope.username, visualization)
.success(function (visualizationData) {
File app.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright 2016 e-UCM (http://www.e-ucm.es/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function onSetActivity
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var onSetActivity = function () {
Classes.get({classId: $scope.activity.classId}).$promise.then(function (c) {
classReady = true;
$scope.class = c;
if ($scope.activity.groupings && $scope.activity.groupings.length > 0) {
Function acceptCourseClass
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.acceptCourseClass = function (classObj) {
var courseId = $scope.courseId.id;
if (courseId === 'NEW') {
if ($scope.newCourse.newName) {
$http.post(CONSTANTS.PROXY + '/courses', {title: $scope.newCourse.newName})
Function createConfig
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createConfig: ['appPrefix', function (done, results) {
var fsOptions = {
encoding: 'utf-8'
};
Function setProgress
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ColumnProgress.prototype.setProgress = function (progress) {
this.progressRectangle
.attr('height', this.height * progress)
.attr('y', this.y + this.height - (this.height * progress));
Function transformRequest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transformRequest: function (data, headersGetter) {
if (data._id !== undefined) {
delete data._id;
}
if (data.classId !== undefined) {
Function selectField
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$scope.selectField = function (visualizationField, newField) {
$scope.dataWithField[visualizationField] = newField;
$scope.selectedVisualizationDevList.forEach(function (visualization) {
$http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualization.id, $scope.dataWithField)
.success(function () {
Function dashboardLink
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var dashboardLink = function (userName, attempt) {
var url = CONSTANTS.KIBANA + '/app/kibana#/dashboard/dashboard_' +
$scope.activity._id + '?embed=true_g=(refreshInterval:(display:\'5%20seconds\',' +
'pause:!f,section:1,value:5000),time:(from:now-1h,mode:quick,to:now))';
if (url.startsWith('localhost')) {
Function modifyGroup
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$ctrl.modifyGroup = function (usr, role, toAdd) {
if ($ctrl.selectedGroup) {
var route;
if (toAdd) {
route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id;