Showing 1,642 of 1,642 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isDefined($attrs.hideNavBar)) {
deregisters.push($scope.$watch($attrs.hideNavBar, function(val) {
navViewCtrl.showBar(!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 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
self.enableBack = function(shouldEnable, disableReset) {
// whether or not the back button show be visible, according
// to the navigation and history
if (arguments.length) {
isBackEnabled = shouldEnable;
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isDefined($attrs.hideBackButton)) {
deregisters.push($scope.$watch($attrs.hideBackButton, function(val) {
navViewCtrl.showBackButton(!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 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 $get
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function($$rAF, $rootScope, $rootElement, $document, $$HashMap,
$$animation, $$AnimateRunner, $templateRequest, $$jqLite) {
Function $get
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) {
Function showPreview
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showPreview( url ) {
closeOverlay();
dom.overlay = document.createElement( 'div' );
Function to
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
to: function( options ) {
// Due to an implementation limitation we can't zoom in
// to another element without zooming out first
if( level !== 1 ) {
Function showHelp
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showHelp() {
if( config.help ) {
closeOverlay();
Function getProgress
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getProgress() {
var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
// The number of past and total slides
Function updateControls
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateControls() {
var routes = availableRoutes();
var fragments = availableFragments();
Function step
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var step = function(virtual) {
// Normalize virtual value
var render = virtual !== true;
Function $ViewDirectiveFill
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {
return {
restrict: 'ECA',
priority: -400,
compile: function (tElement) {
Function invoke
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function invoke(key, invocable, params) {
// Create a deferred for this invocation. Failures will propagate to the resolution as well.
var invocation = $q.defer(), waitParams = 0;
function onfailure(reason) {
invocation.reject(reason);
Function registerState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerState(state) {
// Wrap a new object around the state so we can store our private details easily.
state = inherit(state, {
self: state,
resolve: state.resolve || {},
Function keyboardWaitForResize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function keyboardWaitForResize(callback, isOpening) {
clearInterval(waitForResizeTimer);
var count = 0;
var maxCount;
var initialHeight = getViewportHeight();
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function($scope, $element, $attr) {
if ($attr.noTapScroll == 'true') {
return;
}
ionic.on('tap', onTap, $element[0]);
Function exec
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
UrlMatcher.prototype.exec = function (path, searchParams) {
var m = this.regexp.exec(path);
if (!m) return null;
searchParams = searchParams || {};
Function findState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findState(stateOrName, base) {
if (!stateOrName) return undefined;
var isStr = isString(stateOrName),
name = isStr ? stateOrName : stateOrName.name,
Function animateScroll
has 28 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 = 250, //milliseconds
Function start
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
SlideDrag.prototype.start = function(e) {
var content, buttons, offsetX, buttonsWidth;
if (!this.canSwipe()) {
return;