Showing 7,504 of 7,504 total issues
Function show
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show() {
var parent = $('#wp-auth-check'),
form = $('#wp-auth-check-form'),
noframe = wrap.find('.wp-auth-fallback-expired'),
frame, loaded = false;
Function connect
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function connect() {
var ajaxData, heartbeatData;
// If the connection to the server is slower than the interval,
// heartbeat connects as soon as the previous connection's response is received.
Function addTheme
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.addTheme = function( theme ) {
// make sure we have a name
if ( !theme.name ) {
Galleria.raise('No theme name specified');
Method privReadCentralFileHeader
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function privReadCentralFileHeader(&$p_header)
{
$v_result=1;
// ----- Read the 4 bytes signature
Method update_core
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_core($from, $to) {
global $wp_filesystem, $_old_files, $wpdb;
@set_time_limit( 300 );
Method wp_read_image_metadata
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_read_image_metadata( $file ) {
if ( !file_exists( $file ) )
return false;
list(,,$sourceImageType) = getimagesize( $file );
Method mw_newMediaObject
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mw_newMediaObject($args) {
global $wpdb;
$blog_ID = (int) $args[0];
$username = $wpdb->escape($args[1]);
Method initialise_blog_option_info
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialise_blog_option_info( ) {
global $wp_version;
$this->blog_options = array(
// Read only options
Method wp_editTerm
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_editTerm( $args ) {
if ( ! $this->minimum_args( $args, 5 ) )
return $this->error;
$this->escape( $args );
Method readData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData() {
$this->skipBits(8);
$this->skipBits(8);
$profile = $this->getBits(8); // read profile
$this->skipBits(16);
Method get_categories
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_categories()
{
$categories = array();
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
Method get_categories
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_categories()
{
$categories = array();
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
Method wp_version_check
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_version_check() {
if ( defined('WP_INSTALLING') )
return;
global $wp_version, $wpdb, $wp_local_package;
Method wp_update_plugins
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_update_plugins() {
global $wp_version;
if ( defined('WP_INSTALLING') )
return false;
Method wp_widget_rss_form
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_widget_rss_form( $args, $inputs = null ) {
$default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true );
$inputs = wp_parse_args( $inputs, $default_inputs );
extract( $args );
Method get_categories
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_categories()
{
$categories = array();
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
Method get_categories
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_categories()
{
$categories = array();
foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
Method get_categories
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_categories()
{
$categories = array();
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
Method Manage
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Manage(LocalPasswordModel model)
{
bool hasLocalAccount = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name));
Identical blocks of code found in 4 locations. Consider refactoring. Open
public void Handle(TournamentCreated e)
{
if (Tournaments.ContainsValue(e.Year))
{
var tournament = Tournaments.SingleOrDefault(x => x.Value == e.Year);
- 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 147.
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