File directives.js
has 1434 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Directive to generate e chart diagrams.
*
* uses echarts.js component.
*
Function controller
has 417 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ($scope, $http, $filter, $timeout, $q, HtmlStorage, cfpLoadingBar, Upload, ServiceFoldersData, ServiceFilesData, LuyaLoading, AdminToastService, ServiceFoldersDirectoryId, ServiceAdminTags, ServiceQueueWaiting) {
// ServiceFoldersData inheritance
$scope.foldersData = ServiceFoldersData.data;
Function link
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attr) {
var defaultPosition = 'right';
var lastValue = null;
Function controller
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$filter', 'ServiceFiltersData', 'ServiceImagesData', 'AdminToastService', 'ServiceFilesData', function ($scope, $http, $filter, ServiceFiltersData, ServiceImagesData, AdminToastService, ServiceFilesData) {
// ServiceFiltesrData inheritance
//$scope.ngModel = 0;
Function controller
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
function ($scope, $http, $filter, $timeout, $q, HtmlStorage, cfpLoadingBar, Upload, ServiceFoldersData, ServiceFilesData, LuyaLoading, AdminToastService, ServiceFoldersDirectoryId, ServiceAdminTags, ServiceQueueWaiting) {
Function controller
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$timeout', function($scope, $http, $timeout) {
// the loaded file to crop
$scope.file;
// cropper image
$scope.cropperImage;
Function link
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
scope.elementWidth = 0;
var getElementOriginalWidth = function () {
var elementClone = element.clone().insertAfter(element);
Function controller
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$timeout', function ($scope, $timeout) {
$scope.pageNumberInputVal = $scope.currentPage;
$scope.$watch('currentPage', function(newVal) {
$scope.pageNumberInputVal = newVal;
Function controller
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', function ($scope) {
$scope.input = { showWindow: true };
$scope.content = null;
Function link
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function ($scope, $element, $attrs) {
$scope.$watch('trigger', function (n, o) {
if (n == 0) {
$($attrs.resizerLeft).removeAttr('style');
Consider simplifying this complex logical expression. Open
if ( (!scope.pop || lastValue != scope.tooltipText)
&& (typeof scope.tooltipDisabled === 'undefined' || scope.tooltipDisabled === false)
&& (scope.tooltipText || scope.tooltipImageUrl || scope.tooltipPreviewUrl) ) {
lastValue = scope.tooltipText
Function update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var update = function () {
if ($shadow == null) {
$shadow = angular.element('<div></div>').css({
position: 'absolute',
top: -10000,
Function uploadUsingUpload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.uploadUsingUpload = function (file) {
file.upload = Upload.upload({
url: 'admin/api-admin-storage/files-upload',
fields: { 'folderId': $scope.currentFolderId },
file: file
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
element.bind("focus", function () {
$rootScope.lastElement = element[0];
var offCallFn = $rootScope.$on('insertPasteListener', function (e, val) {
var domElement = $rootScope.lastElement;
Function controller
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', 'ServiceImagesData', function ($scope, ServiceImagesData) {
$scope.imageSrc = null;
$scope.$watch('imageId', function (n, o) {
if (n != o) {
Function pasteUpload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.pasteUpload = function (e) {
for (var i = 0; i < e.originalEvent.clipboardData.items.length; i++) {
var item = e.originalEvent.clipboardData.items[i];
if (item.kind == 'file') {
LuyaLoading.start(i18n['js_dir_upload_wait']);
Function controller
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$filter', 'ServiceFiltersData', 'ServiceImagesData', 'AdminToastService', 'ServiceFilesData', function ($scope, $http, $filter, ServiceFiltersData, ServiceImagesData, AdminToastService, ServiceFilesData) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($scope.api.indexOf('?') > -1) {
var url = $scope.api + '&inline=1';
} else {
var url = $scope.api + '?inline=1';
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($scope.api.indexOf('?') > -1) {
var url = $scope.api + '&inline=1';
} else {
var url = $scope.api + '?inline=1';
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
ServiceFilesData.getFile(n).then(function (response) {
$scope.fileinfo = response;
}, function () {
$scope.fileinfo = null;
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
ServiceFilesData.getFile(n).then(function (file) {
$scope.fileinfo = file;
}, function () {
$scope.fileinfo = null;
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
scope: {
'tooltipText': '@',
'tooltipExpression': '=',
'tooltipPosition': '@',
'tooltipOffsetTop': '@',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$scope.searchPromise = $timeout(function () {
$scope.getFilesForCurrentPage().then(function () {
$scope.searchLoading = false;
cfpLoadingBar.complete()
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76