Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
define('APCAL_MB_APCALLOADED' , 1 ) ;
- 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 975.
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
Space found before comma in function call Open
define('APCAL_MB_APCALLOADED' , 1 ) ;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
- Exclude checks
Space found before comma in function call Open
define('_MD_APCAL_COPYRIGHT' , '');
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
define('_APCAL_SHARECALENDARFORM', 'Dieses Formular ausfüllen, wenn Sie den Kalender auf Ihrer Webseite verwenden möchten.');
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
define('_APCAL_IFCUSTOM', 'Wenn Sie "Individuell anpassen" wählen, füllen Sie bitte den nachstehenden Bereich aus (in CSS).');
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
define('_APCAL_SHAREINFO', 'Für die Verwendung dieses Kalenders in Ihrer Webseite müssen Sie diesen HTML-Code kopieren und in Ihrer Webseite einfügen.');
- Exclude checks
No space found after comma in function call Open
define('_MD_APCAL_ERR_NOPERMTOINSERT',"Keine Berechtigung vorhanden, um Termine hinzuzufügen");
- Exclude checks
No space found after comma in function call Open
define('_MD_APCAL_ALT_PRINTTHISEVENT',"Diesen Termin drucken");
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
if( defined('FOR_XOOPS_LANG_CHECKER') || !defined( 'APCAL_MB_APCALLOADED' ) ) {
- Exclude checks
No space found after comma in function call Open
define('_MB_APCAL_ERR_NOPERMTOUPDATE',"Keine Berechtigung vorhanden, um Termine zu ändern");
- Exclude checks
No space found after comma in function call Open
define('_MB_APCAL_COMESFROM',"Dies ist ein Eintrag auf der Website: %s");
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
define('APCAL_MB_APCALLOADED' , 1 ) ;
- Exclude checks
No space found after comma in function call Open
define('_MD_APCAL_ERR_NOPERMTODELETE',"Keine Berechtigung vorhanden, um Termine zu löschen");
- Exclude checks