Showing 142 of 210 total issues
Function magnify
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function magnify( rect, scale ) {
var scrollOffset = getScrollOffset();
// Ensure a width/height is set
Function cueAutoSlide
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cueAutoSlide() {
cancelAutoSlide();
if( currentSlide && config.autoSlide !== false ) {
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let progress = this.playing ? this.progress : 0,
radius = ( this.diameter2 ) - this.thickness,
x = this.diameter2,
Function destroy
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function destroy() {
initialized = false;
// There's nothing to destroy if this instance hasn't finished
Function load
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load( plugins, dependencies ) {
this.state = 'loading';
plugins.forEach( this.registerPlugin.bind( this ) );
Function slidify
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function slidify( markdown, options ) {
options = getSlidifyOptions( options );
const separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
Function highlightBlock
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
highlightBlock: function( block ) {
hljs.highlightElement( block );
// Don't generate line numbers for empty code blocks
Function getAutoAnimatePairs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getAutoAnimatePairs( fromSlide, toSlide ) {
let pairs = [];
const codeNodes = 'pre';
Function createPageElement
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createPageElement = ( slide, h, v, isVertical ) => {
let contentContainer;
// If this slide is part of an auto-animation sequence, we
Function hiliteWords
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.hiliteWords = function(node)
{
if(node == undefined || !node) return;
if(!matchRegex) return;
if(skipTags.test(node.nodeName)) return;
Function syncScrollPosition
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
syncScrollPosition() {
const viewportHeight = this.viewportElement.offsetHeight;
const viewportHeightFactor = viewportHeight / this.viewportElement.scrollHeight;
Function updateParallax
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateParallax() {
let indices = this.Reveal.getIndices();
if( this.Reveal.getConfig().parallaxBackgroundImage ) {
Function colorToRgb
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const colorToRgb = ( color ) => {
let hex3 = color.match( /^#([0-9a-f]{3})$/i );
if( hex3 && hex3[1] ) {
hex3 = hex3[1];
Function highlightBlock
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
highlightBlock: function( block ) {
hljs.highlightElement( block );
// Don't generate line numbers for empty code blocks
- 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 getIndicesFromHash
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getIndicesFromHash( hash=window.location.hash, options={} ) {
// Attempt to parse the hash as either an index or name
let name = hash.replace( /^#\/?/, '' );
let bits = name.split( '/' );
Function initPlugins
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initPlugins() {
return new Promise( resolve => {
let pluginValues = Object.values( this.registeredPlugins );
Function post
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function post( event ) {
let slideElement = deck.getCurrentSlide(),
notesElements = slideElement.querySelectorAll( 'aside.notes' ),
fragmentElement = slideElement.querySelector( '.current-fragment' );
Function findAutoAnimateMatches
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
findAutoAnimateMatches( pairs, fromScope, toScope, selector, serializer, animationOptions ) {
let fromMatches = {};
let toMatches = {};
Function getIndices
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getIndices( slide ) {
// By default, return the current indices
let h = indexh,
v = indexv,
Consider simplifying this complex logical expression. Open
Open
if( fromSlide && toSlide && fromSlide.hasAttribute( 'data-auto-animate' ) && toSlide.hasAttribute( 'data-auto-animate' )
&& fromSlide.getAttribute( 'data-auto-animate-id' ) === toSlide.getAttribute( 'data-auto-animate-id' )
&& !( toSlideIndex > fromSlideIndex ? toSlide : fromSlide ).hasAttribute( 'data-auto-animate-restart' ) ) {
// Create a new auto-animate sheet