Global variable or function should never be used 2

More information: https://insight.symfony.com/what-we-analyse/php.use_global_variable_or_function

  1. {
  2. $VisitorsStartDate = '';
  3. }
  4. else
  5. {
  6. global $objPage;

    $objPage adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Glen Langer
  7. $VisitorsStartDate = $this->parseDate($objPage->dateFormat, $objVisitors->visitors_startdate);
  8. }
  9. return $VisitorsStartDate;
  10. break;
  11. case "totalvisit":
  • bugbuster1701

    Ignored on Sun, 10 May 2015 21:31:25 GMT
  1. }
  2. //Page Counter
  3. if ($this->_HitCounted === true || $this->_VisitCounted === true)
  4. {
  5. global $objPage;

    $objPage adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

    Time to fix: about 1 day
    Open Issue Permalink
    Last edited by Glen Langer
  6. //if page from cache, we have no page-id
  7. if ($objPage->id == 0)
  8. {
  9. $pageId = $this->getPageIdFromUrl(); // Alias, not ID :-(
  10. // Load a website root page object if there is no page ID
  • bugbuster1701

    Ignored on Sun, 10 May 2015 21:31:33 GMT

exit() and die() functions should be avoided 3

More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function

  1. header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
  2. header ('Pragma: public'); // HTTP/1.0
  3. }
  4. $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
  5. $objWriter->save('php://output');
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Glen Langer
  7. }
  8. protected function exportODS()
  9. {
  10. $objPHPExcel = $this->generateExportData();
  • bugbuster1701

    Ignored on Mon, 09 Nov 2015 19:13:55 GMT
  1. header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
  2. header ('Pragma: public'); // HTTP/1.0
  3. }
  4. $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'OpenDocument');
  5. $objWriter->save('php://output');
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Glen Langer
  7. }
  8. protected function exportCSV()
  9. {
  • bugbuster1701

    Ignored on Fri, 04 Mar 2016 22:29:43 GMT
  1. ->setLineEnding("\r\n")
  2. ->setSheetIndex(0);
  3. $objWriter->save('php://output');
  4. $objWriter = null;
  5. unset($objWriter);
  6. exit;

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Glen Langer
  7. }
  8. protected function generateExportData()
  9. {
  • bugbuster1701

    Ignored on Fri, 04 Mar 2016 22:30:00 GMT

Source code should not contain TODO comments

More information: https://insight.symfony.com/what-we-analyse/task_todo_comment

  1. * Class ModuleVisitorStat
  2. *
  3. * @copyright Glen Langer 2009..2017 <http://contao.ninja>
  4. * @author Glen Langer (BugBuster)
  5. * @package GLVisitors
  6. * @todo Must be completely rewritten.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Glen Langer
  7. */
  8. class ModuleVisitorStat extends \BackendModule
  9. {
  10. /**
  11. * Template
  • bugbuster1701

    Ignored on Fri, 10 Feb 2017 21:33:35 GMT

.htaccess should be avoided 3

More information: https://insight.symfony.com/what-we-analyse/web.apache_config

A .htaccess file has been spotted. You should consider moving it to the server configuration to improve global performances.

Time to fix: about 1 hour
Open Issue Permalink
Last edited by Glen Langer
  • bugbuster1701

    Ignored on Tue, 03 Mar 2015 20:09:14 GMT

A .htaccess file has been spotted. You should consider moving it to the server configuration to improve global performances.

Time to fix: about 1 hour
Open Issue Permalink
Last edited by Glen Langer
  • bugbuster1701

    Ignored on Tue, 03 Mar 2015 20:09:20 GMT

A .htaccess file has been spotted. You should consider moving it to the server configuration to improve global performances.

Time to fix: about 1 hour
Open Issue Permalink
Last edited by Glen Langer
  • bugbuster1701

    Ignored on Tue, 03 Mar 2015 20:09:23 GMT