Showing 142 of 210 total issues
Function slide
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function slide( h, v, f, origin ) {
// Dispatch an event before the slide
const slidechange = dispatchEvent({
type: 'beforeslidechange',
File autoanimate.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { queryAll, extend, createStyleSheet, matches, closest } from '../utils/util.js'
import { FRAGMENT_STYLE_REGEX } from '../utils/constants.js'
// Counter used to generate unique IDs for auto-animated elements
let autoAnimateCounter = 0;
ScrollView
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ScrollView {
constructor( Reveal ) {
this.Reveal = Reveal;
Function load
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
load( slide, options = {} ) {
// Show the slide element
slide.style.display = this.Reveal.getConfig().display;
Function activate
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
activate() {
if( this.active ) return;
const stateBeforeActivation = this.Reveal.getState();
Function syncPages
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
syncPages() {
const config = this.Reveal.getConfig();
const slideSize = this.Reveal.getComputedSlideSize( window.innerWidth, window.innerHeight );
Function update
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
update( index, fragments, slide = this.Reveal.getCurrentSlide() ) {
let changedFragments = {
shown: [],
hidden: []
Function update
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
update( includeAll = false ) {
let config = this.Reveal.getConfig();
let currentSlide = this.Reveal.getCurrentSlide();
let indices = this.Reveal.getIndices();
Function Hilitor
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Hilitor(id, tag) {
var targetNode = document.getElementById(id) || document.body;
var hiliteTag = tag || "EM";
var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM)$");
Function autoAnimateElements
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
autoAnimateElements( from, to, elementOptions, animationOptions, id ) {
// 'from' elements are given a data-auto-animate-target with no value,
// 'to' elements are are given a data-auto-animate-target with an ID
from.dataset.autoAnimateTarget = '';
Function layout
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function layout() {
if( dom.wrapper && !printView.isActive() ) {
const viewportWidth = dom.viewport.offsetWidth;
Function getIndicesFromHash
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. 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( '/' );
- 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 updateSlides
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateSlides( selector, index ) {
// Select all slides and convert the NodeList result to
// an array
let slides = Util.queryAll( dom.wrapper, selector ),
File plugin.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* The reveal.js markdown plugin. Handles parsing of
* markdown inside of presentations as well as loading
* of external markdown documents.
*/
Function onTouchMove
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
onTouchMove( event ) {
if( this.isSwipePrevented( event.target ) ) return true;
let config = this.Reveal.getConfig();
Function KaTeX
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const KaTeX = () => {
let deck;
let defaultOptions = {
version: 'latest',
File slidecontent.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { extend, queryAll, closest, getMimeTypeFromFile, encodeRFC3986URI } from '../utils/util.js'
import { isMobile } from '../utils/device.js'
import fitty from 'fitty';
Function sync
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
sync( slide ) {
const element = slide.slideBackgroundElement,
contentElement = slide.slideBackgroundContentElement;
Function activate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
activate() {
if( this.active ) return;
const stateBeforeActivation = this.Reveal.getState();
- 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 update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
update( includeAll = false ) {
let config = this.Reveal.getConfig();
let currentSlide = this.Reveal.getCurrentSlide();
let indices = this.Reveal.getIndices();
- 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"