Showing 562 of 562 total issues
Function $StateRefActiveDirective
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $StateRefActiveDirective($state, $stateParams, $interpolate) {
return {
restrict: "A",
controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
var state, params, activeClass;
Function animateScroll
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animateScroll(Y, X) {
// scroll animation loop w/ easing
// credit https://gist.github.com/dezinezync/5487119
var start = Date.now(),
duration = 1000, //milliseconds
Function loadViewElements
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadViewElements: function(registerData) {
var x, l, viewEle;
var viewElements = navViewCtrl.getViewElements();
var enteringEleIdentifier = getViewElementIdentifier(viewLocals, enteringView);
var navViewActiveEleId = navViewCtrl.activeEleId();
Function link
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function($scope, $element, $attrs, ctrls) {
var tabsCtrl = ctrls[0],
tabCtrl = ctrls[1];
//Remove title attribute so browser-tooltip does not apear
Function get
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function() {
var self = this;
function update(fn) {
return function() {
var x, classes = self.className.split(/\s+/);
Function instanceMethodCaller
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function instanceMethodCaller(methodName) {
return function caller() {
var handle = this.handle;
var args = arguments;
var foundInstancesCount = 0;
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (isDefined($attr.showDelete)) {
$scope.$watch('!!(' + $attr.showDelete + ')', function(value) {
listCtrl.showDelete(value);
});
}
- 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 56.
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
if (isDefined($attr.showReorder)) {
$scope.$watch('!!(' + $attr.showReorder + ')', function(value) {
listCtrl.showReorder(value);
});
}
- 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 56.
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
if (isDefined($attr.canSwipe)) {
$scope.$watch('!!(' + $attr.canSwipe + ')', function(value) {
listCtrl.canSwipeItems(value);
});
}
- 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 56.
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 resolveElementClasses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveElementClasses(element, cache, runningAnimations) {
runningAnimations = runningAnimations || {};
var lookup = {};
forEach(runningAnimations, function(data, selector) {
Function closeAnimation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function closeAnimation() {
if (!closeAnimation.hasBeenRun) {
if (runner) { //the runner doesn't exist if it fails to instantiate
runner.applyStyles();
}
Function ios
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
provider.transitions.views.ios = function(enteringEle, leavingEle, direction, shouldAnimate) {
function setStyles(ele, opacity, x, boxShadowOpacity) {
var css = {};
css[ionic.CSS.TRANSITION_DURATION] = d.shouldAnimate ? '' : 0;
Function Interceptor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Interceptor = (function () {
function Interceptor(SatellizerConfig, SatellizerShared, SatellizerStorage) {
var _this = this;
this.SatellizerConfig = SatellizerConfig;
this.SatellizerShared = SatellizerShared;
Function promise
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var promise = $http(httpConfig).then(function(response) {
var data = response.data,
promise = value.$promise;
if (data) {
Function getRenderer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getRenderer(attrs, scope) {
var statics = function() {
return {
enter: function (element, target, cb) { target.after(element); cb(); },
leave: function (element, cb) { element.remove(); cb(); }
Function touchMove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.touchMove = function(e) {
if (self.options.freeze || !self.__isDown ||
(!self.__isDown && e.defaultPrevented) ||
(e.target.tagName === 'TEXTAREA' && e.target.parentElement.querySelector(':focus')) ) {
return;
Function fn
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
fn: function(i) {
return {
cx: 16 + (16 * i),
cy: 32,
sw: 0,
Function goBack
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
goBack: function(backCount) {
if (isDefined(backCount) && backCount !== -1) {
if (backCount > -1) return;
var currentHistory = viewHistory.histories[this.currentHistoryId()];
Function collectEventData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
collectEventData: function collectEventData(element, eventType, touches, ev) {
// find out pointerType
var pointerType = ionic.Gestures.POINTER_TOUCH;
if(ev.type.match(/mouse/) || ionic.Gestures.PointerEvent.matchType(ionic.Gestures.POINTER_MOUSE, ev)) {
Function eventListener
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
eventListener(redirectUri): angular.IPromise<any> {
return this.$q((resolve, reject) => {
this.popup.addEventListener('loadstart', (event) => {
if (event.url.indexOf(redirectUri) !== 0) {
return;