Showing 1,311 of 1,311 total issues
Function data
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: function( key, value ) {
var i, name, data,
elem = this[ 0 ],
attrs = elem && elem.attributes;
Function link
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
var initialAnimSkip = true;
var currentTransition;
Function link
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
var initialAnimSkip = true;
var currentTransition;
Similar blocks of code found in 2 locations. Consider refactoring. Open
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
this[ callback ] = true;
- 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 77.
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
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
this[ callback ] = true;
- 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 77.
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 refresh
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Context.prototype.refresh = function() {
var axes, cOffset, isWin,
_this = this;
isWin = $.isWindow(this.element);
Function drawSegments
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSegments(ctx, path, matrix) {
var segments = path._segments,
length = segments.length,
coords = new Array(6),
first = true,
Function drawSegments
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSegments(ctx, path, matrix) {
var segments = path._segments,
length = segments.length,
coords = new Array(6),
first = true,
Function show
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Function open
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
$modal.open = function (modalOptions) {
var modalResultDeferred = $q.defer();
var modalOpenedDeferred = $q.defer();
Function show
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Function open
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
$modal.open = function (modalOptions) {
var modalResultDeferred = $q.defer();
var modalOpenedDeferred = $q.defer();
Function _draw
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_draw: function(ctx, param, strokeMatrix) {
var dontStart = param.dontStart,
dontPaint = param.dontFinish || param.clip,
style = this.getStyle(),
hasFill = style.hasFill(),
Function serialize
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
serialize: function(obj, options, compact, dictionary) {
options = options || {};
var root = !dictionary,
res;
Function _draw
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_draw: function(ctx, param, strokeMatrix) {
var dontStart = param.dontStart,
dontPaint = param.dontFinish || param.clip,
style = this.getStyle(),
hasFill = style.hasFill(),
Function serialize
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
serialize: function(obj, options, compact, dictionary) {
options = options || {};
var root = !dictionary,
res;
Function $LogProvider
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
angular.mock.$LogProvider = function() {
var debug = true;
function concat(array1, array2, index) {
return array1.concat(Array.prototype.slice.call(array2, index));
Function generateBezier
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateBezier: function(first, last, uPrime, tan1, tan2) {
var epsilon = 1e-11,
pt1 = this.points[first],
pt2 = this.points[last],
C = [[0, 0], [0, 0]],
Function generateBezier
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateBezier: function(first, last, uPrime, tan1, tan2) {
var epsilon = 1e-11,
pt1 = this.points[first],
pt2 = this.points[last],
C = [[0, 0], [0, 0]],
Consider simplifying this complex logical expression. Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );