hakimel/reveal.js

View on GitHub

Showing 142 of 210 total issues

Function default has a Cognitive Complexity of 699 (exceeds 5 allowed). Consider refactoring.
Open

export default function( revealElement, options ) {

    // Support initialization with no args, one arg
    // [options] or two args [revealElement, options]
    if( arguments.length < 2 ) {
Severity: Minor
Found in js/reveal.js - About 2 wks 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 default has 1558 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function( revealElement, options ) {

    // Support initialization with no args, one arg
    // [options] or two args [revealElement, options]
    if( arguments.length < 2 ) {
Severity: Major
Found in js/reveal.js - About 1 wk to fix

    File reveal.js has 1589 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import SlideContent from './controllers/slidecontent.js'
    import SlideNumber from './controllers/slidenumber.js'
    import JumpToSlide from './controllers/jumptoslide.js'
    import Backgrounds from './controllers/backgrounds.js'
    import AutoAnimate from './controllers/autoanimate.js'
    Severity: Major
    Found in js/reveal.js - About 4 days to fix

      Function onDocumentKeyDown has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
      Open

          onDocumentKeyDown( event ) {
      
              let config = this.Reveal.getConfig();
      
              // If there's a condition specified and it returns false,
      Severity: Minor
      Found in js/controllers/keyboard.js - About 2 days 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 Plugin has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
      Open

      const Plugin = () => {
      
          // The reveal.js instance this plugin is attached to
          let deck;
      
      
      Severity: Minor
      Found in plugin/markdown/plugin.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 Plugin has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
      Open

      const Plugin = () => {
      
          // The reveal.js instance this plugin is attached to
          let deck;
      
      
      Severity: Minor
      Found in plugin/search/plugin.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 Plugin has 266 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Plugin = () => {
      
          // The reveal.js instance this plugin is attached to
          let deck;
      
      
      Severity: Major
      Found in plugin/markdown/plugin.js - About 1 day to fix

        Function onTouchMove has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            onTouchMove( event ) {
        
                if( this.isSwipePrevented( event.target ) ) return true;
        
                let config = this.Reveal.getConfig();
        Severity: Minor
        Found in js/controllers/touch.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

        File scrollview.js has 493 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { HORIZONTAL_SLIDES_SELECTOR, HORIZONTAL_BACKGROUNDS_SELECTOR } from '../utils/constants.js'
        import { queryAll } from '../utils/util.js'
        
        const HIDE_SCROLLBAR_TIMEOUT = 500;
        const MAX_PROGRESS_SPACING = 4;
        Severity: Minor
        Found in js/controllers/scrollview.js - About 7 hrs to fix

          Function update has a Cognitive Complexity of 47 (exceeds 5 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 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 zoom has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
          Open

          var zoom = (function(){
          
              // The current zoom level (scale)
              var level = 1;
          
          
          Severity: Minor
          Found in plugin/zoom/plugin.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 Plugin has 175 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Plugin = () => {
          
              // The reveal.js instance this plugin is attached to
              let deck;
          
          
          Severity: Major
          Found in plugin/search/plugin.js - About 7 hrs to fix

            Function onDocumentKeyDown has 174 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                onDocumentKeyDown( event ) {
            
                    let config = this.Reveal.getConfig();
            
                    // If there's a condition specified and it returns false,
            Severity: Major
            Found in js/controllers/keyboard.js - About 6 hrs to fix

              Function Plugin has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
              Open

              const Plugin = () => {
              
                  let connectInterval;
                  let speakerWindow = null;
                  let deck;
              Severity: Minor
              Found in plugin/notes/plugin.js - About 6 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 Plugin has 148 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Plugin = () => {
              
                  let connectInterval;
                  let speakerWindow = null;
                  let deck;
              Severity: Major
              Found in plugin/notes/plugin.js - About 5 hrs to fix

                Function load has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                    load( slide, options = {} ) {
                
                        // Show the slide element
                        slide.style.display = this.Reveal.getConfig().display;
                
                
                Severity: Minor
                Found in js/controllers/slidecontent.js - About 5 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 autoAnimateElements has a Cognitive Complexity of 36 (exceeds 5 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 = '';
                Severity: Minor
                Found in js/controllers/autoanimate.js - About 5 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 zoom has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function activate has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      async activate() {
                  
                          const config = this.Reveal.getConfig();
                          const slides = queryAll( this.Reveal.getRevealElement(), SLIDES_SELECTOR )
                  
                  
                  Severity: Major
                  Found in js/controllers/printview.js - About 4 hrs to fix

                    Function syncPages has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        syncPages() {
                    
                            const config = this.Reveal.getConfig();
                    
                            const slideSize = this.Reveal.getComputedSlideSize( window.innerWidth, window.innerHeight );
                    Severity: Minor
                    Found in js/controllers/scrollview.js - About 4 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

                    Severity
                    Category
                    Status
                    Source
                    Language