ggarnier/reveal.rb

View on GitHub

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
 *
Severity: Major
Found in lib/reveal/templates/revealjs/js/reveal.js - About 1 wk to fix

    Function RevealSearch has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
    Open

    var RevealSearch = (function() {
    
        var matchedSlides;
        var currentMatchedIndex;
        var searchboxDirty;
    Severity: Minor
    Found in lib/reveal/templates/revealjs/plugin/search/search.js - About 1 day to fix

    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;
    
    
    Severity: Minor
    Found in lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js - About 7 hrs to fix

    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;
    Severity: Major
    Found in lib/reveal/templates/revealjs/plugin/search/search.js - About 6 hrs to fix

      Function zoom has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var zoom = (function(){
      
          // The current zoom level (scale)
          var level = 1;
      
      
      Severity: Major
      Found in lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js - About 6 hrs to fix

        Function RevealNotes has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var RevealNotes = (function() {
        
            function openNotes( notesFilePath ) {
        
                if( !notesFilePath ) {
        Severity: Major
        Found in lib/reveal/templates/revealjs/plugin/notes/notes.js - About 3 hrs to fix

          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
          Severity: Major
          Found in lib/reveal/templates/revealjs/js/reveal.js - About 3 hrs to fix

            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;
            
            
            Severity: Major
            Found in lib/reveal/templates/revealjs/js/reveal.js - About 3 hrs to fix

              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
              Severity: Major
              Found in lib/reveal/templates/revealjs/js/reveal.js - About 3 hrs to fix

                Function RevealNotes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                var RevealNotes = (function() {
                
                    function openNotes( notesFilePath ) {
                
                        if( !notesFilePath ) {
                Severity: Minor
                Found in lib/reveal/templates/revealjs/plugin/notes/notes.js - About 2 hrs to fix

                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";
                Severity: Major
                Found in lib/reveal/templates/revealjs/plugin/search/search.js - About 2 hrs to fix

                  Function loadSlide has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function loadSlide( slide, options ) {
                  
                          options = options || {};
                  
                          // Show the slide element
                  Severity: Major
                  Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                    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 ) {
                    Severity: Major
                    Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                      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
                      Severity: Major
                      Found in lib/reveal/templates/revealjs/plugin/notes/notes.js - About 2 hrs to fix

                        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
                        Severity: Major
                        Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                          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 ) ),
                          Severity: Major
                          Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                            Function layout has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function layout() {
                            
                                    if( dom.wrapper && !isPrintingPDF() ) {
                            
                                        var size = getComputedSlideSize();
                            Severity: Major
                            Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                              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
                              Severity: Major
                              Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix

                                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
                                Severity: Major
                                Found in lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js - About 2 hrs to fix

                                  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' ),
                                  Severity: Major
                                  Found in lib/reveal/templates/revealjs/js/reveal.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language