Showing 1,311 of 1,311 total issues
Function add
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function matcherFromGroupMatchers
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
Function smooth
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
smooth: function() {
var segments = this._segments,
size = segments.length,
closed = this._closed,
n = size,
Function smooth
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
smooth: function() {
var segments = this._segments,
size = segments.length,
closed = this._closed,
n = size,
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Function updateRoute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateRoute() {
var next = parseRoute(),
last = $route.current;
if (next && last && next.$$route === last.$$route
File angular-route.js
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license AngularJS v1.2.20
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( !assert(function( div ) {
return div.getAttribute("disabled") == null;
}) ) {
addHandle( booleans, function( elem, name, isXML ) {
var val;
- 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 88.
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 ( !assert(function( div ) {
return div.getAttribute("disabled") == null;
}) ) {
addHandle( booleans, function( elem, name, isXML ) {
var val;
- 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 88.
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 setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function View
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function View(project, element) {
this._project = project;
this._scope = project._scope;
this._element = element;
var size;
Function getWinding
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getWinding(point, curves, horizontal, testContains) {
var TOLERANCE = 0.00001,
x = point.x,
y = point.y,
windLeft = 0,
Function getWinding
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getWinding(point, curves, horizontal, testContains) {
var TOLERANCE = 0.00001,
x = point.x,
y = point.y,
windLeft = 0,
Function View
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function View(project, element) {
this._project = project;
this._scope = project._scope;
this._element = element;
var size;
Function importSVG
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function importSVG(source, options, isRoot) {
if (!source)
return null;
if (!options) {
options = {};
Function execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function execute(code, scope, url, options) {
paper = scope;
var view = scope.getView(),
tool = /\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(code)
? new Tool()
Function importSVG
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function importSVG(source, options, isRoot) {
if (!source)
return null;
if (!options) {
options = {};
Function $IntervalProvider
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
angular.mock.$IntervalProvider = function() {
this.$get = ['$rootScope', '$q',
function($rootScope, $q) {
var repeatFns = [],
nextRepeatId = 0,