Showing 73 of 73 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
layoutService.getGuestMode().then(function(guest) {
$scope.guestMode = guest;
return guest;
}).catch(function() {
$log.warn('could not retrieve guest mode');
- 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 62.
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
layoutService.getGuestMode().then(function(result) {
$scope.guestMode = result;
return result;
})
.catch(function() {
- 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 62.
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
Function addToHome
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addToHome = function addToHome(portlet) {
var fname = portlet.fname;
var ret = layoutService.addToHome(portlet, $sessionStorage.layout);
ret.then(
function successCallback(response) {
Function addToHome
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addToHome = function addToHome(portlet) {
console.log("market: portlet", portlet);
var fname = portlet.fname;
var ret = layoutService.addToHome(portlet);
console.log("market: fname", fname);
Function addToHome
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.addToHome = function(portlet) {
console.log("addToHome: pportlet", portlet);
var ret = layoutService.addToHome(portlet);
console.log("addToHome: ret", ret);
ret.success(function(request, text) {
Function persistAndUse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var persistAndUse = function(result) {
$log.log('persistAndUse: got data from old layout backend: ' +
result.data.layout);
var formattedOldLayout = formatLayoutForCache(result.data);
Similar blocks of code found in 2 locations. Consider refactoring. Open
define(['require'], function(require) {
return {
staticMax: {
templateUrl: require.toUrl('./partials/static-content-max.html'),
},
- 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 60.
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
define(['require'], function(require) {
return {
main: {
templateUrl: require.toUrl('./partials/marketplace.html'),
},
- 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 60.
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
Function addToHome
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.addToHome = function(portlet) {
var ret = layoutService.addToHome(portlet);
ret.success(function(request, text) {
angular.element('.fname-' + portlet.fname)
.html('<span style="color : green;">' +
Function moveWithKeyboard
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.moveWithKeyboard = function(widget, event) {
var result = $filter('filter')($scope.$parent.layout, widget);
var currentIndex = $scope.$parent.layout.indexOf(result[0]);
var previousIndex = currentIndex - 1;
var nextIndex = currentIndex + 1;
Function getPortlets
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getPortlets = function() {
return checkMarketplaceCache().then(function(data) {
var successFn;
var errorFn;
var defer;
Function moveWithKeyboard
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.moveWithKeyboard = function(widget, event) {
// Get index independent of ng-repeat to avoid filter bugs
var currentIndex =
findLayoutIndex($scope.layout, 'nodeId', widget.nodeId);
var previousIndex = currentIndex - 1;
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($sessionStorage.marketplace != null) {
// Filter for fname match in marketplace
var marketplaceEntries = $filter('filter')(
$sessionStorage.marketplace, fname
);
- 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 58.
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 ($sessionStorage.marketplace != null) {
// Filter for fname match in marketplace
var marketplaceEntries = $filter('filter')(
$sessionStorage.marketplace, fname
);
- 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 58.
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
Function init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var init = function() {
// init variables
$scope.portlets = [];
marketplaceService.getPortlets().then(function(data) {
$scope.portlets = data.portlets;
Function filterAppsBySearchTerm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var filterAppsBySearchTerm = function(apps) {
// Filter by title matches first
var appsWithMatchingTitle =
marketplaceService.filterPortletsBySearchTerm(
apps,
Function getExclusiveMarkup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getExclusiveMarkup = function(portlet) {
return $http.get(SERVICE_LOC.context +
'/p/' + portlet.fname + '/exclusive/render.uP', {cache: true})
.then(function(result) {
var data = result.data;
Similar blocks of code found in 2 locations. Consider refactoring. Open
$scope.onSelect = function(portlet) {
$location.path('apps/details/'+ portlet.fname);
$scope.initialFilter = '';
$scope.showSearch = false;
$scope.showSearchFocus = false;
- 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 55.
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
if ($scope.initialFilter != '') {
$location.path('apps/search/'+ $scope.initialFilter);
$scope.initialFilter = '';
$scope.showSearch = false;
$scope.showSearchFocus = false;
- 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 55.
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
Function invokeCallback
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function invokeCallback(expression, event, dropEffect, itemType, index, item) {