XoopsModules25x/apcal

View on GitHub
index.php

Summary

Maintainability
A
3 hrs
Test Coverage

File index.php has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
Severity: Minor
Found in index.php - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

    if ((!isset($_GET['action']) || $_GET['action'] === '') && isset($_GET['cid']) && !is_numeric($_GET['cid'])) {
        $cat_title = addslashes($_GET['cid']);
        $cat       = $GLOBALS['xoopsDB']->queryF("SELECT cid FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cat_shorttitle LIKE '$cat_title' LIMIT 0,1");
    
        if ($cat && $GLOBALS['xoopsDB']->getRowsNum($cat)) {
    Severity: Major
    Found in index.php - About 1 hr to fix

      Line exceeds 120 characters; contains 157 characters
      Open

      $xoopsTpl->assign('xoops_module_header', "<style><!-- \n" . $cal->get_embed_css() . "\n--></style>\n" . $xoopsTpl->get_template_vars('xoops_module_header'));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 229 characters
      Open

          $event      = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->queryF("SELECT summary, description, location, categories, contact, start FROM {$GLOBALS['xoopsDB']->prefix('apcal_event')} WHERE id={$event_id} LIMIT 0,1"));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 132 characters
      Open

          $dateTitle    = (isset($_GET['smode']) && $_GET['smode'] === 'Yearly' ? '' : $cal->month_long_names[$date[1]] . ' ') . $date[0];
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 307 characters
      Open

                          <a href="http://www.delicious.com/save" title="Delicious" onclick="window.open(\'http://www.delicious.com/save?v=5&noui&jump=close&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title), \'delicious\',\'toolbar=no,width=550,height=550\'); return false;">
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 154 characters
      Open

                              <img src="' . XOOPS_URL . '/modules/apcal/assets/images/delicious.png" height="20" width="20" alt="Delicious" title="Delicious" />
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 184 characters
      Open

                          <div class="fb-like" data-href="' . XOOPS_URL . '/modules/apcal" data-send="false" data-layout="button_count" data-action="recommend" data-show-faces="false"></div>
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 186 characters
      Open

          $cat          = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->queryF("SELECT cat_title, cat_desc FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cid={$cid} LIMIT 0,1"));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

          $cat       = $GLOBALS['xoopsDB']->queryF("SELECT cid FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cat_shorttitle LIKE '$cat_title' LIMIT 0,1");
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

                          <script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: \'' . _APCAL_GPLUS_LNG . '\'}</script>
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 198 characters
      Open

          $xoopsTpl->assign('xoops_module_header', '<script type="text/javascript" src="' . XOOPS_URL . '/modules/apcal/ajax/pictures.js"></script>' . $xoopsTpl->get_template_vars('xoops_module_header'));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                      <link rel="stylesheet" type="text/css" media="all" href="' . $jscalurl . '/CSS/calendar-blue.css" title="system" />
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 194 characters
      Open

                                  <img src="' . XOOPS_URL . '/modules/apcal/assets/images/tellafriend.png" height="20" width="20" alt="' . _APCAL_TELLAFRIEND . '" title="' . _APCAL_TELLAFRIEND . '" />
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 178 characters
      Open

                  $title = $GLOBALS['xoopsDB']->fetchObject($GLOBALS['xoopsDB']->queryF("SELECT cat_title FROM {$GLOBALS['xoopsDB']->prefix('apcal_cat')} WHERE cid={$cat} LIMIT 0,1"));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

                          <a href="' . $cal->base_url . '/print.php?cid=' . $cal->now_cid . '&smode=' . $smode . '&caldate=' . $cal->caldate . '" target="_blank">
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 294 characters
      Open

                              <a href="" title="' . _APCAL_TELLAFRIEND . '" onclick="window.open(\'' . XOOPS_URL . '/modules/apcal/tellafriend.php?url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title), \'_blank\',\'toolbar=no,width=800,height=450\'); return false;">
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 155 characters
      Open

                          <a href="https://twitter.com/share" class="twitter-share-button" data-url="' . XOOPS_URL . '/modules/apcal" data-count="none">Tweet</a>
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 199 characters
      Open

          $event   = $GLOBALS['xoopsDB']->queryF("SELECT id FROM {$GLOBALS['xoopsDB']->prefix('apcal_event')} WHERE shortsummary='$summary' AND UNIX_TIMESTAMP(DATE(FROM_UNIXTIME(start)))=$date LIMIT 0,1");
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                          <script type="text/javascript" src="http://connect.facebook.net/' . _APCAL_FB_LNG . '/all.js#xfbml=1"></script>
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 200 characters
      Open

      $xoopsTpl->assign('xoops_module_header', '<link rel="stylesheet" type="text/css" href="' . XOOPS_URL . '/modules/apcal/assets/css/apcal.css" />' . $xoopsTpl->get_template_vars('xoops_module_header'));
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 135 characters
      Open

                              <img src="' . $cal->images_url . '/print.gif" alt="' . _APCAL_BTN_PRINT . '" border="0" ' . PRINT_ATTRIB . ' />
      Severity: Minor
      Found in index.php by phpcodesniffer

      Line exceeds 120 characters; contains 300 characters
      Open

              echo '<div class="share"><a href="' . XOOPS_URL . '/modules/apcal/shareCalendar.php" title="' . _APCAL_SHARECALENDAR . '"><img src="' . XOOPS_URL . '/modules/apcal/assets/images/share.png" /><span style="line-height: 32px; margin-bottom: 15px;">' . _APCAL_SHARECALENDAR . '</span></a></div>';
      Severity: Minor
      Found in index.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status