Showing 60 of 101 total issues
File reveal.js
has 2754 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* reveal.js
* http://revealjs.com
* MIT licensed
*
Function RevealSearch
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
var RevealSearch = (function() {
var matchedSlides;
var currentMatchedIndex;
var searchboxDirty;
- 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 zoom
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
var zoom = (function(){
// The current zoom level (scale)
var level = 1;
- 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 RevealSearch
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RevealSearch = (function() {
var matchedSlides;
var currentMatchedIndex;
var searchboxDirty;
Function zoom
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
var zoom = (function(){
// The current zoom level (scale)
var level = 1;
Function RevealNotes
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RevealNotes = (function() {
function openNotes( notesFilePath ) {
if( !notesFilePath ) {
Function configure
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function configure( options ) {
var oldTransition = config.transition;
// New config options may be passed when this method
Function slide
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function slide( h, v, f, o ) {
// Remember where we were at before
previousSlide = currentSlide;
Function setupPDF
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupPDF() {
var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight );
// Dimensions of the PDF pages
Function RevealNotes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
var RevealNotes = (function() {
function openNotes( notesFilePath ) {
if( !notesFilePath ) {
- 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 Hilitor
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Hilitor(id, tag)
{
var targetNode = document.getElementById(id) || document.body;
var hiliteTag = tag || "EM";
Function loadSlide
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSlide( slide, options ) {
options = options || {};
// Show the slide element
Function onDocumentKeyDown
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onDocumentKeyDown( event ) {
// If there's a condition specified and it returns false,
// ignore this event
if( typeof config.keyboardCondition === 'function' && config.keyboardCondition() === false ) {
Function openNotes
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function openNotes( notesFilePath ) {
if( !notesFilePath ) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
Function updateBackground
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateBackground( includeAll ) {
var currentBackground = null;
// Reverse past/future classes when in RTL mode
Function updateSlides
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateSlides( selector, index ) {
// Select all slides and convert the NodeList result to
// an array
var slides = toArray( dom.wrapper.querySelectorAll( selector ) ),
Function layout
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function layout() {
if( dom.wrapper && !isPrintingPDF() ) {
var size = getComputedSlideSize();
Function onTouchMove
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onTouchMove( event ) {
if( isSwipePrevented( event.target ) ) return true;
// Each touch should only trigger one action
Function magnify
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function magnify( rect, scale ) {
var scrollOffset = getScrollOffset();
// Ensure a width/height is set
Function createBackground
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createBackground( slide, container ) {
var data = {
background: slide.getAttribute( 'data-background' ),
backgroundSize: slide.getAttribute( 'data-background-size' ),