Showing 133 of 5,402 total issues
Function setUpDefaultAccordion
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
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() {
Function initRentalPage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initRentalPage() {
function galleryRentalVenues() {
var galleryBtn = jQuery('.venue-rental-gallery-button');
galleryBtn.click(function(event){
Function initProgramsAndEvents
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>');
}
Function initActivityPage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
function initActivityPage () {
function activityFeatureSwiper() {
var ww = jQuery(window).width();
var slidesview = 3;
if (ww<=740) {
- Read upRead up
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
Open
function no_results(target, type) {
(type) ? type = type : type = 'event';
var message = '';
Function setUpSubMenuHover
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setUpSubMenuHover () {
// SubMenu for Utility Nav
jQuery('.utility-nav').children('.menu-item-has-children').hover(function(){
jQuery(this).addClass('open');
Function showCurrentPage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function interactiveParkMap
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function interactiveParkMap () {
var allMarkers = jQuery('#interactive-park-map').find('.marker');
//var geocoder = new google.maps.Geocoder();
Function initParkPage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function initParkPage() {
function expandParkDescription() {
jQuery('.park-banner-description-button').click(function() {
if(!jQuery(this).hasClass('open')) {
jQuery(this).addClass('open');
- Read upRead up
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
Open
function alerts() {
if(jQuery('.alert').length > 0) {
var alert = jQuery('.alert');
var alertCloseBtn = jQuery('.alert-close-button');
Function squareSectionAreas
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function squareSectionAreas() {
function equalHeights(group) {
tallest = 0;
group.each(function() {
thisHeight = jQuery(this).height();
Function findCorrespondingBox
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findCorrespondingBox(typeOfBox, button, buttonData) {
if(typeOfBox == "Amenity") {
amenityInfoBoxes.each(function(){
box = jQuery(this);
Function parkAccordion
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parkAccordion() {
var mainTitle = jQuery('.park-accordion-area > .main-title');
mainTitle.click(function() {
var content = jQuery(this).siblings('.park-accordion-content');
Function initTrailsPage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initTrailsPage () {
function trailsAccordianArea() {
var accordArea = jQuery('.rental-collapse-area');
if(window.location.hash) {
Function loadVideo
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Video.prototype.loadVideo = function(src, addClass, noposter, index, html) {
var video = '';
var autoplay = 1;
var a = '';
var isVideo = this.core.isVideo(src, index) || {};
Function post_ajax
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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'; }
Function initHomePage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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', {
Function eventRegister
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function eventRegister(trgt) {
if(!trgt) return;
var url = 'https://reservations.metroparks.org/api/v1/programs/register';
Function parkFeatureSwiper
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parkFeatureSwiper() {
var ww = jQuery(window).width();
var slidesview = 3;
if (ww<=740) {
slidesview = 1;
Function post_ajax
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var post_ajax = function(target_elm, post_type, post_status, category_name, taxonomy, term, order, orderby, posts_per_page, key, value) {