codefordayton/metroparks-tribute

View on GitHub

Showing 133 of 5,402 total issues

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

  function setUpDefaultAccordion() {
    var accordArea = jQuery('.rental-collapse-area');
    if(window.location.hash) {
      var hash = window.location.hash.substr(1);
      jQuery('.rental-collapse-area').each(function() {
Severity: Minor
Found in tribute_files/main.js - About 1 hr to fix

    Function initRentalPage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function initRentalPage() {
      function galleryRentalVenues() {
        var galleryBtn = jQuery('.venue-rental-gallery-button');
    
       galleryBtn.click(function(event){
    Severity: Minor
    Found in tribute_files/main.js - About 1 hr to fix

      Function initProgramsAndEvents has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function initProgramsAndEvents() {
        function addListViewButtons() {
          jQuery('.subpage-headline').after('<div class="events-list-buttons-area"><button class="events-list-view-btn open" type="button"></button><button class="events-calendar-view-btn" type="button"></button></div>');
        } 
      
      
      Severity: Minor
      Found in tribute_files/main.js - About 1 hr to fix

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

        function initActivityPage () {
          function  activityFeatureSwiper() {
            var ww = jQuery(window).width();
            var slidesview = 3;
            if (ww<=740) {
        Severity: Minor
        Found in tribute_files/main.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 no_results has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function no_results(target, type) {
              
              (type) ? type = type : type = 'event';
              
              var message = '';
        Severity: Minor
        Found in tribute_files/insivia-frmp-script.js - About 1 hr to fix

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

              function setUpSubMenuHover () {
          
                  // SubMenu for Utility Nav
                  jQuery('.utility-nav').children('.menu-item-has-children').hover(function(){
                      jQuery(this).addClass('open');
          Severity: Minor
          Found in tribute_files/navigation.js - About 1 hr to fix

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

                  function showCurrentPage() {
                      if (window.location.href.indexOf("places-to-go") > -1) {
                        jQuery('.places-to-go').parent().addClass('current');
                    }
                    if (window.location.href.indexOf("things-to-do") > -1) {
            Severity: Minor
            Found in tribute_files/navigation.js - About 1 hr to fix

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

              function interactiveParkMap () {
              
                var allMarkers = jQuery('#interactive-park-map').find('.marker'); 
                //var geocoder = new google.maps.Geocoder();
              
              
              Severity: Minor
              Found in tribute_files/interactive-map.js - About 1 hr to fix

                Function initParkPage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                function initParkPage() {
                  function expandParkDescription() {
                      jQuery('.park-banner-description-button').click(function() {
                        if(!jQuery(this).hasClass('open')) {
                          jQuery(this).addClass('open');
                Severity: Minor
                Found in tribute_files/main.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 alerts has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function alerts() {
                    if(jQuery('.alert').length > 0) {
                      var alert = jQuery('.alert');
                      var alertCloseBtn = jQuery('.alert-close-button');
                
                
                Severity: Minor
                Found in tribute_files/main.js - About 1 hr to fix

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

                  function squareSectionAreas() {
                    function equalHeights(group) {
                      tallest = 0;
                      group.each(function() {
                          thisHeight = jQuery(this).height();
                  Severity: Minor
                  Found in tribute_files/main.js - About 1 hr to fix

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

                        function findCorrespondingBox(typeOfBox, button, buttonData) {
                          if(typeOfBox == "Amenity") {
                    
                            amenityInfoBoxes.each(function(){
                            box = jQuery(this);
                    Severity: Minor
                    Found in tribute_files/main.js - About 1 hr to fix

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

                        function parkAccordion() {
                          var mainTitle = jQuery('.park-accordion-area > .main-title');
                      
                          mainTitle.click(function() {
                            var content = jQuery(this).siblings('.park-accordion-content'); 
                      Severity: Minor
                      Found in tribute_files/main.js - About 1 hr to fix

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

                        function initTrailsPage () {
                          function trailsAccordianArea() {
                            var accordArea = jQuery('.rental-collapse-area');
                        
                            if(window.location.hash) {
                        Severity: Minor
                        Found in tribute_files/main.js - About 1 hr to fix

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

                              Video.prototype.loadVideo = function(src, addClass, noposter, index, html) {
                                  var video = '';
                                  var autoplay = 1;
                                  var a = '';
                                  var isVideo = this.core.isVideo(src, index) || {};
                          Severity: Minor
                          Found in tribute_files/lightgallery.min.js - About 1 hr to fix

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

                              var post_ajax = function(target_elm, post_type, post_status, category_name, taxonomy, term, order, orderby, posts_per_page, key, value) {
                                
                                //Check if vars are empty and assign a default value if it is
                                if(!post_type) { post_type = 'activity'; } 
                                if(!post_status) { post_status = 'publish'; }
                            Severity: Minor
                            Found in tribute_files/main.js - About 1 hr to fix

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

                              function initHomePage() {
                                // Set up Swiper for homepage
                                function homeSwiper() {
                                  var swiperSpeed = jQuery('.swiper-container').attr('data-slideshow-speed');
                                  var mySwiper = new Swiper('.swiper-container', {
                              Severity: Minor
                              Found in tribute_files/main.js - About 1 hr to fix

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

                                    function eventRegister(trgt) {
                                      
                                      if(!trgt) return;
                                      
                                      var url = 'https://reservations.metroparks.org/api/v1/programs/register';
                                Severity: Minor
                                Found in tribute_files/insivia-frmp-script.js - About 1 hr to fix

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

                                    function  parkFeatureSwiper() {
                                      var ww = jQuery(window).width();
                                      var slidesview = 3;
                                      if (ww<=740) {
                                        slidesview = 1; 
                                  Severity: Minor
                                  Found in tribute_files/main.js - About 1 hr to fix

                                    Function post_ajax has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      var post_ajax = function(target_elm, post_type, post_status, category_name, taxonomy, term, order, orderby, posts_per_page, key, value) {
                                    Severity: Major
                                    Found in tribute_files/main.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language