hakimel/reveal.js

View on GitHub

Showing 142 of 210 total issues

Function magnify has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function magnify( rect, scale ) {

        var scrollOffset = getScrollOffset();

        // Ensure a width/height is set
Severity: Minor
Found in plugin/zoom/plugin.js - About 1 hr to fix

    Function cueAutoSlide has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function cueAutoSlide() {
    
            cancelAutoSlide();
    
            if( currentSlide && config.autoSlide !== false ) {
    Severity: Minor
    Found in js/reveal.js - About 1 hr to fix

      Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
      
              let progress = this.playing ? this.progress : 0,
                  radius = ( this.diameter2 ) - this.thickness,
                  x = this.diameter2,
      Severity: Minor
      Found in js/components/playback.js - About 1 hr to fix

        Function destroy has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function destroy() {
        
                initialized = false;
        
                // There's nothing to destroy if this instance hasn't finished
        Severity: Minor
        Found in js/reveal.js - About 1 hr to fix

          Function load has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              load( plugins, dependencies ) {
          
                  this.state = 'loading';
          
                  plugins.forEach( this.registerPlugin.bind( this ) );
          Severity: Minor
          Found in js/controllers/plugins.js - About 1 hr to fix

            Function slidify has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function slidify( markdown, options ) {
            
                    options = getSlidifyOptions( options );
            
                    const separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ),
            Severity: Minor
            Found in plugin/markdown/plugin.js - About 1 hr to fix

              Function highlightBlock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  highlightBlock: function( block ) {
              
                      hljs.highlightElement( block );
              
                      // Don't generate line numbers for empty code blocks
              Severity: Minor
              Found in plugin/highlight/plugin.js - About 1 hr to fix

                Function getAutoAnimatePairs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    getAutoAnimatePairs( fromSlide, toSlide ) {
                
                        let pairs = [];
                
                        const codeNodes = 'pre';
                Severity: Minor
                Found in js/controllers/autoanimate.js - About 1 hr to fix

                  Function createPageElement has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          const createPageElement = ( slide, h, v, isVertical ) => {
                  
                              let contentContainer;
                  
                              // If this slide is part of an auto-animation sequence, we
                  Severity: Minor
                  Found in js/controllers/scrollview.js - About 1 hr to fix

                    Function hiliteWords has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.hiliteWords = function(node)
                            {
                                if(node == undefined || !node) return;
                                if(!matchRegex) return;
                                if(skipTags.test(node.nodeName)) return;
                    Severity: Minor
                    Found in plugin/search/plugin.js - About 1 hr to fix

                      Function syncScrollPosition has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          syncScrollPosition() {
                      
                              const viewportHeight = this.viewportElement.offsetHeight;
                              const viewportHeightFactor = viewportHeight / this.viewportElement.scrollHeight;
                      
                      
                      Severity: Minor
                      Found in js/controllers/scrollview.js - About 1 hr to fix

                        Function updateParallax has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            updateParallax() {
                        
                                let indices = this.Reveal.getIndices();
                        
                                if( this.Reveal.getConfig().parallaxBackgroundImage ) {
                        Severity: Minor
                        Found in js/controllers/backgrounds.js - About 1 hr to fix

                          Function colorToRgb has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const colorToRgb = ( color ) => {
                          
                              let hex3 = color.match( /^#([0-9a-f]{3})$/i );
                              if( hex3 && hex3[1] ) {
                                  hex3 = hex3[1];
                          Severity: Minor
                          Found in js/utils/color.js - About 1 hr to fix

                            Function highlightBlock has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                highlightBlock: function( block ) {
                            
                                    hljs.highlightElement( block );
                            
                                    // Don't generate line numbers for empty code blocks
                            Severity: Minor
                            Found in plugin/highlight/plugin.js - About 1 hr 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 getIndicesFromHash has 35 lines of code (exceeds 25 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( '/' );
                            Severity: Minor
                            Found in js/controllers/location.js - About 1 hr to fix

                              Function initPlugins has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  initPlugins() {
                              
                                      return new Promise( resolve => {
                              
                                          let pluginValues = Object.values( this.registeredPlugins );
                              Severity: Minor
                              Found in js/controllers/plugins.js - About 1 hr to fix

                                Function post has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function post( event ) {
                                
                                        let slideElement = deck.getCurrentSlide(),
                                            notesElements = slideElement.querySelectorAll( 'aside.notes' ),
                                            fragmentElement = slideElement.querySelector( '.current-fragment' );
                                Severity: Minor
                                Found in plugin/notes/plugin.js - About 1 hr to fix

                                  Function findAutoAnimateMatches has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      findAutoAnimateMatches( pairs, fromScope, toScope, selector, serializer, animationOptions ) {
                                  
                                          let fromMatches = {};
                                          let toMatches = {};
                                  
                                  
                                  Severity: Minor
                                  Found in js/controllers/autoanimate.js - About 1 hr to fix

                                    Function getIndices has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function getIndices( slide ) {
                                    
                                            // By default, return the current indices
                                            let h = indexh,
                                                v = indexv,
                                    Severity: Minor
                                    Found in js/reveal.js - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      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
                                      Severity: Critical
                                      Found in js/controllers/autoanimate.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language