Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
// $Id: modulesadmin.php 11129 2011-03-29 00:57:50Z skenow $
//%%%%%% File Name modulesadmin.php %%%%%
define("_MD_AM_MODADMIN","Modules Administration");
define("_MD_AM_MODULE","Module");
- 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 1704.
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
Expected 1 space after comma in function call; 2 found Open
define('_MD_AM_TABLE_CREATED', 'Table %s created.');
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
define('_MD_AM_CONFIGOPTION_DELETED', 'Config data deleted from the database. Config ID: %s');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_VERSION","Version");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ACTION","Action");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_DUPEN","Duplicate entry in modules table!");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_UPDTED","The selected module has been updated!");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILUNINS","Unable to uninstall %s.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_DEACTED","The selected module has been deactivated. You can now safely uninstall the module.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_SYSNO","System module cannot be deactivated.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_NOTINSTALLED","Not Installed");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILINS","Unable to install %s.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_INACTIVE","Inactive");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_SUBMIT","Submit");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_CANCEL","Cancel");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILDEACT","Unable to deactivate %s.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILWRITE","Unable to write to main menu.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_FUNCT_EXEC','Function %s is successfully executed.');
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_MOD_UP_TEM','Updating templates...');
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_COMPILE_FAIL','ERROR: Failed compiling template %s.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKDEACT","Module %s deactivated successfully.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_COMPILED','Template %s compiled.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ORDER0","(0 = hide)");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_UNINSTALL","Uninstall");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILORDER","Unable to reorder %s.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_MOD_REBUILD_BLOCKS','Rebuilding blocks...');
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_INSERTED','Template %s added to the database. (ID: %s)');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_PCMFM","Please confirm:");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_STRTNO","This module is set as your default start page. Please change the start module to whatever suits your preferences.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKINS","Module %s installed successfully.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_MODULE","Module");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ACTED","The selected module has been activated!");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_DBUPDATE","Database updated successfully!");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_MOD_DATA_UPDATED',' Module data updated.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_UPDATE_FAIL","Unable to update %s.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_RECOMPILE_FAIL','ERROR: Could not recompile template %s.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKUPD","Module %s updated successfully.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_UPDATE_FAIL','ERROR: Could not update template %s.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_DEACTIVATE","Deactivate");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ACTIVATE","Activate");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ORDER","Order");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ACTIVE","Active");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_INSERT_FAIL','ERROR: Could not insert template %s to the database.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKUNINS","Module %s uninstalled successfully.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKORDER","Module %s changed successfully.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_FAIL_EXEC','Failed to execute %s.');
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_UPDATE","Update");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_FAILACT","Unable to activate %s.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_MODADMIN","Modules Administration");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_DEACTIVATED","Deactivated");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_NOCHANGE","No Change");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_BTOMADMIN","Back to Module Administration page");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_OKACT","Module %s activated successfully.");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_LASTUP","Last Update");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_INSTALL","Install");
- Exclude checks
No space found after comma in function call Open
define("_MD_AM_ALEXISTS","Module %s already exists.");
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_INSTALLING','Installing ');
- Exclude checks
No space found after comma in function call Open
define('_MD_AM_TEMPLATE_RECOMPILED','Template %s recompiled.');
- Exclude checks