hakimel/reveal.js

View on GitHub

Showing 210 of 210 total issues

Function getAutoAnimatableProperties has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getAutoAnimatableProperties( direction, element, elementOptions ) {

        let config = this.Reveal.getConfig();

        let properties = { styles: [] };
Severity: Minor
Found in js/controllers/autoanimate.js - About 1 hr to fix

    Function update has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        update() {
    
            let routes = this.Reveal.availableRoutes();
    
            // Remove the 'enabled' class from all directions
    Severity: Minor
    Found in js/controllers/controls.js - About 1 hr to fix

      Function MathJax2 has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const MathJax2 = () => {
      
          // The reveal.js instance this plugin is attached to
          let deck;
      
      
      Severity: Minor
      Found in plugin/math/mathjax2.js - About 1 hr to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            toggle( override ) {
        
                if( typeof override === 'boolean' ) {
                    override ? this.activate() : this.deactivate();
                }
        Severity: Major
        Found in js/controllers/scrollview.js and 1 other location - About 1 hr to fix
        js/controllers/overview.js on lines 200..209

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            toggle( override ) {
        
                if( typeof override === 'boolean' ) {
                    override ? this.activate() : this.deactivate();
                }
        Severity: Major
        Found in js/controllers/overview.js and 1 other location - About 1 hr to fix
        js/controllers/scrollview.js on lines 184..193

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function run has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            run( fromSlide, toSlide ) {
        
                // Clean up after prior animations
                this.reset();
        
        
        Severity: Minor
        Found in js/controllers/autoanimate.js - About 1 hr to fix

          Function updateParallax has a Cognitive Complexity of 15 (exceeds 5 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

          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 jump has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              jump() {
          
                  clearTimeout( this.jumpTimeout );
                  delete this.jumpTimeout;
          
          
          Severity: Minor
          Found in js/controllers/jumptoslide.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 startEmbeddedIframe has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              startEmbeddedIframe( event ) {
          
                  let iframe = event.target;
          
                  if( iframe && iframe.contentWindow ) {
          Severity: Minor
          Found in js/controllers/slidecontent.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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              render() {
          
                  this.element = document.createElement( 'div' );
                  this.element.className = 'backgrounds';
                  this.Reveal.getRevealElement().appendChild( this.element );
          Severity: Major
          Found in js/controllers/backgrounds.js and 1 other location - About 1 hr to fix
          js/controllers/slidenumber.js on lines 19..25

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              run( fromSlide, toSlide ) {
          
                  // Clean up after prior animations
                  this.reset();
          
          
          Severity: Minor
          Found in js/controllers/autoanimate.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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              render() {
          
                  this.element = document.createElement( 'div' );
                  this.element.className = 'slide-number';
                  this.Reveal.getRevealElement().appendChild( this.element );
          Severity: Major
          Found in js/controllers/slidenumber.js and 1 other location - About 1 hr to fix
          js/controllers/backgrounds.js on lines 15..21

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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
                          Severity
                          Category
                          Status
                          Source
                          Language