Showing 142 of 210 total issues
Function sync
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sync() {
// Subscribe to input
removeEventListeners();
addEventListeners();
Function loadExternalMarkdown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadExternalMarkdown( section ) {
return new Promise( function( resolve, reject ) {
const xhr = new XMLHttpRequest(),
Function sort
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
sort( fragments, grouped = false ) {
fragments = Array.from( fragments );
let ordered = [],
Consider simplifying this complex logical expression. Open
if( autoSlide && !autoSlidePaused && !isPaused() && !overview.isActive() && ( !isLastSlide() || fragments.availableRoutes().next || config.loop === true ) ) {
autoSlideTimeout = setTimeout( () => {
if( typeof config.autoSlideMethod === 'function' ) {
config.autoSlideMethod()
}
Function scrollHighlightedLineIntoView
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
scrollHighlightedLineIntoView: function( block, scrollState, skipAnimation ) {
cancelAnimationFrame( scrollState.animationFrameID );
// Match the scroll position of the currently visible
- 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 init
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
init: function( reveal ) {
reveal.getRevealElement().addEventListener( 'mousedown', function( event ) {
var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
- 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 writeURL
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
writeURL( delay ) {
let config = this.Reveal.getConfig();
let currentSlide = this.Reveal.getCurrentSlide();
- 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 onSlideClicked
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onSlideClicked( event ) {
if( this.isActive() ) {
event.preventDefault();
- 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 registerPlugin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
registerPlugin( plugin ) {
// Backwards compatibility to make reveal.js ~3.9.0
// plugins work with reveal.js 4.0.0
if( arguments.length === 2 && typeof arguments[0] === 'string' ) {
- 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 KaTeX
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const KaTeX = () => {
let deck;
let defaultOptions = {
version: 'latest',
- 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
Avoid deeply nested control flow statements. Open
else if( i === index && config.fragments ) {
if( loopedForwards ) {
hideFragmentsIn( element );
}
else if( loopedBackwards ) {
Avoid deeply nested control flow statements. Open
if( config.navigationMode === 'linear' ) {
if( config.rtl ) {
this.Reveal.prev();
}
else {
Avoid deeply nested control flow statements. Open
if( isMobile ) {
video.muted = true;
video.setAttribute( 'playsinline', '' );
}
Avoid deeply nested control flow statements. Open
if( slide.classList.contains( 'stack' ) ) {
slide.style.top = 0;
}
else {
slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px';
Avoid deeply nested control flow statements. Open
if( type ) {
sourceElement.setAttribute( 'type', type );
}
Avoid deeply nested control flow statements. Open
if( event.shiftKey ) {
this.Reveal.slide( undefined, 0 );
}
else if( !this.Reveal.overview.isActive() && useLinearMode ) {
this.Reveal.prev({skipFragments: event.altKey});
Avoid deeply nested control flow statements. Open
if( config.fragments ) {
// Hide all fragments in future slides
hideFragmentsIn( element );
}
Avoid deeply nested control flow statements. Open
if ( typeof aPreviousChildElement.setAttribute === 'function' && aPreviousChildElement.tagName !== "BR" ) {
previousParentElement = aPreviousChildElement;
break;
}
Avoid deeply nested control flow statements. Open
else if( keyCode === 74 || keyCode === 40 ) {
if( event.shiftKey ) {
this.Reveal.slide( undefined, Number.MAX_VALUE );
}
else if( !this.Reveal.overview.isActive() && useLinearMode ) {
Avoid deeply nested control flow statements. Open
if( distanceX + distanceY < viewDistance ) {
slideContent.load( verticalSlide );
}
else {
slideContent.unload( verticalSlide );