File main.php
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (defined('MAIN_DEFINED')) {
return;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
if (defined('MAIN_DEFINED')) {
return;
}
- 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 5114.
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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 6 and the first side effect is on line 4. Open
<?php
- Exclude checks
Line exceeds 120 characters; contains 194 characters Open
define('_MD_DESC_UNSTICKY', 'Once you press the unSticky button at the bottom of this form the topic you have selected will be unStickyed. You may Sticky it again at a later time if you like.');
- Exclude checks
Line exceeds 120 characters; contains 186 characters Open
define('_MD_DESC_UNLOCK', 'Once you press the unlock button at the bottom of this form the topic you have selected will be unlocked. You may lock it again at a later time if you like.');
- Exclude checks
Line exceeds 120 characters; contains 183 characters Open
define('_MD_DESC_MOVE', 'Once you press the move button at the bottom of this form the topic you have selected, and its related posts, will be moved to the forum you have selected.');
- Exclude checks
Line exceeds 120 characters; contains 265 characters Open
define('_MD_DESC_MERGE', 'Once you press the merge button at the bottom of this form the topic you have selected, and its related posts, will be merged to the topic you have selected.<br><strong>The destination topic ID must be smaller than current one</strong>.');
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
define('_MD_DESC_LOCK', 'Once you press the lock button at the bottom of this form the topic you have selected will be locked. You may unlock it at a later time if you like.');
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
//define('_MD_PRIVATE', 'This is a <strong>Private</strong> forum.<br>Only users with special access can post new topics and replies to this forum');
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
define('_MD_SUSPEND_TEXT', 'User %s is suspended for %d days due to:<br>[quote]%s[/quote]<br><br>The suspension is valid till %s');
- Exclude checks
Line exceeds 120 characters; contains 191 characters Open
define('_MD_DESC_DELETE', 'Once you press the delete button at the bottom of this form the topic you have selected, and all its related posts, will be <strong>permanently</strong> removed.');
- Exclude checks
Line exceeds 120 characters; contains 224 characters Open
// !!IMPORTANT!! insert '\' before any char among reserved chars: "a", "A", "B", "c", "d", "D", "F", "g", "G", "h", "H", "i", "I", "j", "l", "L", "m", "M", "n", "O", "r", "s", "S", "t", "T", "U", "w", "W", "Y", "y", "z", "Z"
- Exclude checks
Line exceeds 120 characters; contains 173 characters Open
define('_MD_INVALID_SUBMIT', 'Invalid submission. You could have exceeded session time. Please re-submit or make a backup of your post and login to resubmit if necessary.');
- Exclude checks
Line exceeds 120 characters; contains 194 characters Open
define('_MD_DESC_UNDIGEST', 'Once you press the unDigest button at the bottom of this form the topic you have selected will be unDigested. You may Digest it again at a later time if you like.');
- Exclude checks
Line exceeds 120 characters; contains 190 characters Open
define('_MD_DESC_STICKY', 'Once you press the Sticky button at the bottom of this form the topic you have selected will be Stickyed. You may unSticky it again at a later time if you like.');
- Exclude checks
Line exceeds 120 characters; contains 190 characters Open
define('_MD_DESC_DIGEST', 'Once you press the Digest button at the bottom of this form the topic you have selected will be Digested. You may unDigest it again at a later time if you like.');
- Exclude checks