Showing 295 of 1,637 total issues
Function getIndices
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getIndices( slide ) {
// By default, return the current indices
var h = indexh,
v = indexv,
Function promise
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var promise = $http(httpConfig).then(function(response) {
var data = response.data,
promise = value.$promise;
if (data) {
Function ios
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 collectEventData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 touchMove
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 getRenderer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(); }
Consider simplifying this complex logical expression. Open
Open
if( autoSlide && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || availableFragments().next || config.loop === true ) ) {
autoSlideTimeout = setTimeout( navigateNext, autoSlide );
autoSlideStartTime = Date.now();
}
Consider simplifying this complex logical expression. Open
Open
if (nativeScrolling) {
// use native scrolling
$element.addClass('overflow-scroll');
scrollViewOptions = {
Consider simplifying this complex logical expression. Open
Open
if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
Consider simplifying this complex logical expression. Open
Open
} else if (currentView && currentView.historyId !== historyId &&
hist.cursor > -1 && hist.stack.length > 0 && hist.cursor < hist.stack.length &&
hist.stack[hist.cursor].stateId === currentStateId) {
// they just changed to a different history and the history already has views in it
var switchToView = hist.stack[hist.cursor];
Function RevealNotes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
var RevealNotes = (function() {
function openNotes() {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function updatePositions
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
self.updatePositions = function(titleEle, updateTitleLeft, updateTitleRight, buttonsLeft, buttonsRight, updateCss, showPreviousTitle) {
Function $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function($window, $$jqLite, $$AnimateRunner, $timeout,
$document, $sniffer, $$rAFScheduler) {
Function CollectionRepeatDirective
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$rAF, $rootScope, $timeout) {
Avoid deeply nested control flow statements. Open
Open
if( touch.captured || isVerticalSlide( currentSlide ) ) {
event.preventDefault();
}
Avoid deeply nested control flow statements. Open
Open
if (handler.comment) handler.comment(html.substring(4, index));
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
create: function(navViewCtrl, viewLocals, enteringView, leavingView, renderStart, renderEnd) {
Avoid deeply nested control flow statements. Open
Open
if( distanceX + distanceY < viewDistance ) {
showSlide( verticalSlide );
}
else {
hideSlide( verticalSlide );
Avoid deeply nested control flow statements. Open
Open
if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) {
previousParentElement = aPreviousChildElement;
break;
}
Avoid deeply nested control flow statements. Open
Open
while( pastFragments.length ) {
var pastFragment = pastFragments.pop();
pastFragment.classList.add( 'visible' );
pastFragment.classList.remove( 'current-fragment' );
}