File events.php
has 304 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.
Consider simplifying this complex logical expression. Open
if (isset($_POST['delete'])) {
// Ticket Check
if (!$xoopsGTicket->check()) {
redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($_POST['delete'])) {
// Ticket Check
if (!$xoopsGTicket->check()) {
redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 254.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
switch ($tz) {
case 's':
$tzoffset = 0;
$tzdisp = ($serverTZ >= 0 ? '+' : '-') . sprintf('%02d:%02d', abs($serverTZ), abs($serverTZ) * 60 % 60);
$tzoptions = str_replace("'s'>", "'s' selected>", $tzoptions);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 235.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($event->allday) {
$start_desc = date(_AM_APCAL_DTFMT_LIST_ALLDAY, $event->start) . '<br>(' . _APCAL_MB_ALLDAY_EVENT . ')';
$end_desc = date(_AM_APCAL_DTFMT_LIST_ALLDAY, $event->end - 300) . '<br>(' . _APCAL_MB_ALLDAY_EVENT . ')';
} else {
$start_desc = date(_AM_APCAL_DTFMT_LIST_NORMAL, $event->start + $tzoffset);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 140.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Blank line found at start of control structure Open
if (isset($_POST['delete'])) {
- Exclude checks
Blank line found at start of control structure Open
} elseif (isset($_POST['addlink']) && isset($_POST['ids']) && is_array($_POST['ids']) && $_POST['cid'] > 0) {
- Exclude checks
Blank line found at start of control structure Open
) {
- Exclude checks
Blank line found at start of control structure Open
} elseif (isset($_POST['output_ics_confirm']) && !empty($_POST['ids']) && is_array($_POST['ids'])) {
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$nav = new XoopsPageNav($numrows, $num, $pos, 'pos', "cid=$cid&tz=$tz&num=$num&pf=$pf&txt=" . urlencode($txt));
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
<form class='apcalForm' id='MainForm' name='MainForm' action='?tz=$tz&num=$num&cid=$cid' method='post' style='margin-top:0px;'>
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$cat_selbox4extract = str_replace("<option value='0'>", "<option value='0'>" . _ALL . "</option>\n<option value='-1'" . ($cid == -1 ? 'selected' : '') . '>', $cat_selbox);
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$sql = "UPDATE $cal->table SET categories=CONCAT(categories,'$cid4sql') WHERE ($whr 0) AND categories NOT LIKE '%$cid4sql%'";
- Exclude checks
Line exceeds 120 characters; contains 183 characters Open
<th><input type='checkbox' name='dummy' onclick=\"with(document.MainForm){for (i=0;i<length;i++) {if (elements[i].type=='checkbox') {elements[i].checked=this.checked;}}}\" /></th>
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
<p><style='color: blue; '>" . (isset($_GET['mes']) ? htmlspecialchars($_GET['mes'], ENT_QUOTES) : '') . "</style></p>\n" . (isset($confirm_html) ? $confirm_html : '') . "
- Exclude checks
Line exceeds 120 characters; contains 206 characters Open
<td class='$oddeven' align='right'><a href='$mod_url/index.php?action=Edit&event_id=$event->id' target='_blank'><img src='$cal->images_url/addevent.gif' border='0' width='14' height='12' /></a></td>
- Exclude checks