Showing 235 of 235 total issues
Function link
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, $element, attr, ctrl, $transclude) {
var currentScope,
currentElement,
previousLeaveAnimation,
autoScrollExp = attr.autoscroll,
Function trunc
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function trunc(string, options, guard) {
if (guard && isIterateeCall(string, options, guard)) {
options = undefined;
}
var length = DEFAULT_TRUNC_LENGTH,
Function instant
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
$translate.instant = function (translationId, interpolateParams, interpolationId) {
// Detect undefined and null values to shorten the execution and prevent exceptions
if (translationId === null || angular.isUndefined(translationId)) {
return translationId;
Function $$AnimateJsDriverProvider
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {
$$animationProvider.drivers.push('$$animateJsDriver');
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
Function resolveElementClasses
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveElementClasses(existing, toAdd, toRemove) {
var ADD_CLASS = 1;
var REMOVE_CLASS = -1;
var flags = {};
Function okCallback
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var okCallback = function(response) {
var resData = response.data;
var fullParams = response.config.params;
var data = parseResponse(resData, operation, whatFetched, url, response, deferred);
Function okCallback
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var okCallback = function(response) {
var resData = response.data;
var fullParams = response.config.params;
var data = parseResponse(resData, operation, whatFetched, url, response, deferred);
Function mixin
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mixin(object, source, options) {
if (options == null) {
var isObj = isObject(source),
props = isObj ? keys(source) : undefined,
methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
Function baseClone
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
var result;
if (customizer) {
result = object ? customizer(value, key, object) : customizer(value);
}
Function loadAsync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var loadAsync = function (key) {
if (!key) {
throw 'No language key specified for loading.';
}
Function start
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var closeActiveAnimations;
var chain = [];
if (before) {
Function areAnimationsAllowed
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function areAnimationsAllowed(element, parentElement, event) {
var bodyElementDetected = false;
var rootElementDetected = false;
var parentAnimationDetected = false;
var animateChildren;
Function $get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
var fromAnimation = prepareAnimation(animationDetails.from);
var toAnimation = prepareAnimation(animationDetails.to);
Identical blocks of code found in 2 locations. Consider refactoring. Open
function removeMarkers() {
console.log('Removing markers from map...');
$.each(markers, function(i, m) {
m.setMap(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 68.
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
function removeMarkers() {
console.log('Removing markers from map...');
$.each(markers, function(i, m) {
m.setMap(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 68.
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 $get
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$injector', '$log', function ($injector, $log) {
var applyStrategies = function (value, mode, selectedStrategies) {
angular.forEach(selectedStrategies, function (selectedStrategy) {
if (angular.isFunction(selectedStrategy)) {
Function lazyValue
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
Function mergeData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < ARY_FLAG;
Function createFlow
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createFlow(fromRight) {
return function() {
var wrapper,
length = arguments.length,
index = fromRight ? length : -1,
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({