Showing 7,504 of 7,504 total issues
Method parse_iri
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse_iri($iri)
{
$iri = trim($iri, "\x20\x09\x0A\x0C\x0D");
if (preg_match('/^((?P<scheme>[^:\/?#]+):)?(\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match))
{
Method change_encoding_mbstring
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function change_encoding_mbstring($data, $input, $output)
{
if ($input === 'windows-949')
{
$input = 'EUC-KR';
Method new_line
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function new_line()
{
$this->value = trim($this->value, "\x0D\x20");
if ($this->name !== '' && $this->value !== '')
{
Method atom_03_construct_type
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function atom_03_construct_type($attribs)
{
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
{
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
Method image_resize_dimensions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) {
if ($orig_w <= 0 || $orig_h <= 0)
return false;
// at least one of dest_w or dest_h must be specific
Method wp_parse_auth_cookie
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_parse_auth_cookie($cookie = '', $scheme = '') {
if ( empty($cookie) ) {
switch ($scheme){
case 'auth':
$cookie_name = AUTH_COOKIE;
Method new_line
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function new_line()
{
$this->value = trim($this->value, "\x0D\x20");
if ($this->name !== '' && $this->value !== '')
{
Method atom_03_construct_type
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function atom_03_construct_type($attribs)
{
if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
{
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
Method output_javascript
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function output_javascript()
{
if (function_exists('ob_gzhandler'))
{
ob_start('ob_gzhandler');
Method get_iri
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_iri()
{
$iri = '';
if ($this->scheme !== null)
{
Method wp_cookie_constants
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_cookie_constants() {
/**
* Used to guarantee unique hash cookies
*
* @since 1.5.0
Method translate_header
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function translate_header( $header, $value ) {
switch ( $header ) {
case 'Name' :
// Cached for sorting reasons.
if ( isset( $this->name_translated ) )
Method the_content_rss
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
_deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' );
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content_rss', $content);
if ( $cut && !$encode_html )
Method wp_unique_filename
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
// sanitize the file name before we begin processing
$filename = sanitize_file_name($filename);
// separate the filename into a name and extension
Method sanitize_file_name
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sanitize_file_name( $filename ) {
$filename_raw = $filename;
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
$special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
$filename = str_replace($special_chars, '', $filename);
Method Expand
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Expand($name) {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
Method Handle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void Handle(RoomCheckinChanged e)
{
var tournament = GetTournamentFromContingentId(e.Id);
var contingentRooms = tournament.ContingentRooms.FirstOrDefault(x => x.Id == e.Id);
Similar blocks of code found in 4 locations. Consider refactoring. Open
Form.Element.Observer = Class.create(Abstract.TimedObserver, {
getValue: function() {
return Form.Element.getValue(this.element);
}
});
- 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 58.
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 4 locations. Consider refactoring. Open
Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
getValue: function() {
return Form.Element.getValue(this.element);
}
});
- 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 58.
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
else if( (completeEndingChars.indexOf('|'+fromChar+'|')!= -1 || completeChars.indexOf('|'+fromChar+'|')!=-1) && CodePress.autocomplete) { // auto complete
if(!CodePress.completeEnding(fromChar))
CodePress.complete(fromChar);
}
else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting
- 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 58.
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