Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
// $Id: users.php 11034 2011-02-19 20:12:41Z skenow $
//%%%%%% Admin Module Name Users %%%%%
if (!defined('_AM_DBUPDATED')) {define("_AM_DBUPDATED","Database Updated Successfully!");}
- 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 821.
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
No space found after comma in function call Open
define("_AM_YMCACF","You must complete all required fields");
- Exclude checks
No space found after comma in function call Open
define("_AM_ADDUSER","Add User");
- Exclude checks
No space found after comma in function call Open
define("_AM_AVATAR","Avatar");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNGUSERID","Could not get user IDS");
- Exclude checks
No space found after comma in function call Open
define("_AM_USERS_DELETEED","deleted");
- Exclude checks
No space found after comma in function call Open
define("_AM_MODIFYUSER","Modify User");
- Exclude checks
No space found after comma in function call Open
define("_AM_ICQ","ICQ");
- Exclude checks
No space found after comma in function call Open
define("_AM_AIM","AIM");
- Exclude checks
No space found after comma in function call Open
define("_AM_NSRID","No Special Ranks in Database");
- Exclude checks
No space found after comma in function call Open
define("_AM_RETYPEPD","Retype Password");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNGTST","Could not get total stories");
- Exclude checks
No space found after comma in function call Open
define('_AM_BADPWD','Bad Password, Password can not contain username.');
- Exclude checks
No space found after comma in function call Open
define("_AM_A_USER_WITH_THIS_EMAIL_ADDRESS","A user with this email address");
- Exclude checks
Newline required after opening brace Open
if (!defined('_AM_DBUPDATED')) {define("_AM_DBUPDATED","Database Updated Successfully!");}
- Exclude checks
No space found after comma in function call Open
define("_AM_GO","Go!");
- Exclude checks
No space found after comma in function call Open
define("_AM_NAME","Name");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNGTCOM","Could not get total comments");
- Exclude checks
No space found after comma in function call Open
define("_AM_DELUSER","Delete User");
- Exclude checks
No space found after comma in function call Open
define("_AM_ADMIN_CAN_NOT_BE_DELETEED","Admin user cannot be deleted");
- Exclude checks
No space found after comma in function call Open
define("_AM_NICKNAME","Displayname");
- Exclude checks
No space found after comma in function call Open
define("_AM_THEME","Theme");
- Exclude checks
No space found after comma in function call Open
define("_AM_NOTACTIVE","This user has not been activated. Do you wish to activate this user?");
- Exclude checks
No space found after comma in function call Open
define("_AM_LOCATION","Location");
- Exclude checks
No space found after comma in function call Open
define("_AM_USERPOST","User Posts");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNRNU","Could not register new user.");
- Exclude checks
No space found after comma in function call Open
if (!defined('_AM_DBUPDATED')) {define("_AM_DBUPDATED","Database Updated Successfully!");}
- Exclude checks
No space found after comma in function call Open
define("_AM_EDEUSER","Edit/Delete Users");
- Exclude checks
No space found after comma in function call Open
define("_AM_NSRA","No Special Rank Assigned");
- Exclude checks
No space found after comma in function call Open
define("_AM_CHANGEONLY","(for changes only)");
- Exclude checks
No space found after comma in function call Open
define("_AM_PTBBTSDIYT","Push the button below to synchronize data if you think the above user posts info does not seem to indicate the actual status");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNUUSER","Could not update user");
- Exclude checks
No space found after comma in function call Open
define("_AM_LOGINNAME","Loginname");
- Exclude checks
Closing brace must be on a line by itself Open
if (!defined('_AM_DBUPDATED')) {define("_AM_DBUPDATED","Database Updated Successfully!");}
- Exclude checks
No space found after comma in function call Open
define("_AM_NO","No");
- Exclude checks
No space found after comma in function call Open
define("_AM_STORIES","Stories");
- Exclude checks
No space found after comma in function call Open
define("_AM_COMMENTS","Comments");
- Exclude checks
No space found after comma in function call Open
define("_AM_SYNCHRONIZE","Synchronize");
- Exclude checks
No space found after comma in function call Open
define("_AM_COULD_NOT_DELETE","Could not delete");
- Exclude checks
No space found after comma in function call Open
define("_AM_YES","Yes");
- Exclude checks
No space found after comma in function call Open
define("_AM_INTEREST","Interest");
- Exclude checks
No space found after comma in function call Open
define("_AM_UPDATEUSER","Update User");
- Exclude checks
No space found after comma in function call Open
define("_AM_USERINFO","User Info");
- Exclude checks
No space found after comma in function call Open
define("_AM_BYTHIS","By doing this all the info for this user will be removed permanently.");
- Exclude checks
No space found after comma in function call Open
define("_AM_AOUTVTEAD","Allow other users to view this email address");
- Exclude checks
No space found after comma in function call Open
define("_AM_OCCUPATION","Occupation");
- Exclude checks
No space found after comma in function call Open
define("_AM_PASSWORD","Password");
- Exclude checks
No space found after comma in function call Open
define("_AM_ALREADY_EXISTS","already exists");
- Exclude checks
No space found after comma in function call Open
define("_AM_AYSYWTDU","Are you sure you want to delete user %s?");
- Exclude checks
No space found after comma in function call Open
define("_AM_OPTION","Option");
- Exclude checks
No space found after comma in function call Open
define("_AM_YIM","YIM");
- Exclude checks
No space found after comma in function call Open
define("_AM_MSNM","MSNM");
- Exclude checks
No space found after comma in function call Open
define("_AM_ACCESSLEV","Access Level");
- Exclude checks
No space found after comma in function call Open
define("_AM_INDICATECOF","* indicates required fields");
- Exclude checks
No space found after comma in function call Open
define("_AM_REMOVED_USERS","Removed Users");
- Exclude checks
No space found after comma in function call Open
define("_AM_EMAIL","Email");
- Exclude checks
No space found after comma in function call Open
define("_AM_SIGNATURE","Signature");
- Exclude checks
No space found after comma in function call Open
define("_AM_USERDONEXIT","User doesn't exist!");
- Exclude checks
No space found after comma in function call Open
define("_AM_CNRNU2","The new user could not be added to groups: %s.");
- Exclude checks
No space found after comma in function call Open
define("_AM_USERID","User ID");
- Exclude checks
No space found after comma in function call Open
define("_AM_STNPDNM","Sorry, the new passwords do not match. Click back and try again");
- Exclude checks
No space found after comma in function call Open
define("_AM_URL","URL");
- Exclude checks
No space found after comma in function call Open
define("_AM_RANK","Rank");
- Exclude checks
No space found after comma in function call Open
define("_AM_LIST","List");
- Exclude checks