Showing 7,504 of 7,504 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
$bookmark = (int) $bookmark;
$bookmark = get_bookmark( $bookmark );
if ( is_wp_error($bookmark) )
- 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 114.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( navigator.userAgent && document.body.className.indexOf( 'no-font-face' ) === -1 &&
/Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test( navigator.userAgent ) ) {
document.body.className += ' no-font-face';
}
- 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 68.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( navigator.userAgent && document.body.className.indexOf( 'no-font-face' ) === -1 &&
/Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7|MSIE 7/.test( navigator.userAgent ) ) {
document.body.className += ' no-font-face';
}
- 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 68.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.setPrimaryButton( l10n.replace, function( controller, state ) {
var attachment = state.get( 'selection' ).single();
controller.media.changeAttachment( attachment );
state.trigger( 'replace', controller.media.toJSON() );
} );
- 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 68.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.setPrimaryButton( this.addText, function( controller, state ) {
var attachment = state.get( 'selection' ).single();
controller.media.setSource( attachment );
state.trigger( 'add-source', controller.media.toJSON() );
} );
- 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 68.
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
Function ArrayType
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ArrayType(type, mode) {
function bindTo(type, callbackName) {
return function() {
return type[callbackName].apply(type, arguments);
};
Function load
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.prototype.load = function() {
// pass if no data is provided or flickr option not found
if ( arguments.length || typeof this._options.flickr !== 'string' ) {
load.apply( this, Galleria.utils.array( arguments ) );
Function practiceController
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var practiceController = function ($scope, $http, $q, $location, dataService) {
var url = $location.absUrl();
var lastSlash = url.lastIndexOf('/');
var province = url.slice(lastSlash + 1);
var year = url.slice(lastSlash - 4, lastSlash);
Function editDivisions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editDivisions(teams) {
var modalPromise = modalFactory.Divisions(teams);
modalPromise.then(function (data) {
//var currentTeams = $scope.model.Teams;
Function centresController
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var centresController = function ($http, $q, $location, dataService) {
var url = $location.absUrl();
var lastSlash = url.lastIndexOf('/');
var year = url.slice(lastSlash + 1);
Function paintElement
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
paintElement: function( $element, colorType ) {
var xml, encoded, color;
if ( ! colorType || ! colorscheme.hasOwnProperty( colorType ) ) {
return;
Function initialize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function( options ) {
var self = this;
// Set up parent
this.parent = options.parent;
Function cb
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cb() {
if (cbInvoked++) return;
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
Function setOptions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOptions: function(options) {
this.options = Object.extend({
choices: 10,
partialSearch: true,
partialChars: 2,
Function load
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.prototype.load = function() {
// pass if no data is provided or flickr option not found
if ( arguments.length || typeof this._options.flickr !== 'string' ) {
load.apply( this, Galleria.utils.array( arguments ) );
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var options = _.defaults( this.model.toJSON(), {
orientation: 'landscape',
uploading: false,
type: '',
Method PclZipUtilPathReduction
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PclZipUtilPathReduction($p_dir)
{
$v_result = "";
// ----- Look for not empty path
Method privExtractFileUsingTempFile
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function privExtractFileUsingTempFile(&$p_entry, &$p_options)
{
$v_result=1;
// ----- Creates a temporary file
Method PclZipUtilPathInclusion
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PclZipUtilPathInclusion($p_dir, $p_path)
{
$v_result = 1;
// ----- Look for path beginning by ./
Method wp_iframe
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_iframe($content_func /* ... */) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>