hakimel/reveal.js

View on GitHub

Showing 142 of 210 total issues

File backgrounds.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { queryAll } from '../utils/util.js'
import { colorToRgb, colorBrightness } from '../utils/color.js'

/**
 * Creates and updates slide backgrounds.
Severity: Minor
Found in js/controllers/backgrounds.js - About 2 hrs to fix

    Function update has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        update( index, fragments, slide = this.Reveal.getCurrentSlide() ) {
    
            let changedFragments = {
                shown: [],
                hidden: []
    Severity: Minor
    Found in js/controllers/fragments.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 sync has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        sync( slide ) {
    
            const element = slide.slideBackgroundElement,
                contentElement = slide.slideBackgroundContentElement;
    
    
    Severity: Minor
    Found in js/controllers/backgrounds.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 configure has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function configure( options ) {
    
            const oldConfig = { ...config }
    
            // New config options may be passed when this method
    Severity: Major
    Found in js/reveal.js - About 2 hrs to fix

      Function pages has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this.pages = pageElements.map( pageElement => {
                  const page = this.createPage({
                      pageElement,
                      slideElement: pageElement.querySelector( 'section' ),
                      stickyElement: pageElement.querySelector( '.scroll-page-sticky' ),
      Severity: Major
      Found in js/controllers/scrollview.js - About 2 hrs to fix

        File gulpfile.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const pkg = require('./package.json')
        const glob = require('glob')
        const yargs = require('yargs')
        const through = require('through2');
        const qunit = require('node-qunit-puppeteer')
        Severity: Minor
        Found in gulpfile.js - About 2 hrs to fix

          Function updateSlidesVisibility has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function updateSlidesVisibility() {
          
                  // Select all slides and convert the NodeList result to
                  // an array
                  let horizontalSlides = getHorizontalSlides(),
          Severity: Major
          Found in js/reveal.js - About 2 hrs to fix

            Function getHash has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                getHash( slide ) {
            
                    let url = '/';
            
                    // Attempt to create a named link based on the slide's ID
            Severity: Minor
            Found in js/controllers/location.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 goto has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                goto( index, offset = 0 ) {
            
                    let currentSlide = this.Reveal.getCurrentSlide();
                    if( currentSlide && this.Reveal.getConfig().fragments ) {
            
            
            Severity: Minor
            Found in js/controllers/fragments.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 getSlideNumber has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                getSlideNumber( slide = this.Reveal.getCurrentSlide() ) {
            
                    let config = this.Reveal.getConfig();
                    let value;
                    let format = SLIDE_NUMBER_FORMAT_HORIZONTAL_DOT_VERTICAL;
            Severity: Minor
            Found in js/controllers/slidenumber.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 startEmbeddedContent has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                startEmbeddedContent( element ) {
            
                    if( element && !this.Reveal.isSpeakerNotes() ) {
            
                        // Restart GIFs
            Severity: Minor
            Found in js/controllers/slidecontent.js - About 2 hrs to fix

              Function MathJax3 has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const MathJax3 = () => {
              
                  // The reveal.js instance this plugin is attached to
                  let deck;
              
              
              Severity: Minor
              Found in plugin/math/mathjax3.js - About 2 hrs to fix

                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

                      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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language