Showing 176 of 176 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
shade = '<v:rect strokeweight="0" filled="'+f+'" stroked="f" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+db+'px;left:'+db+'px;width:'+(width-offset-(2*border))+'px;height:'+hz+'px;"><v:fill method="sigma" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+(opacity/2)+'" /></v:rect><v:rect strokeweight="0" filled="'+f+'" stroked="f" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+(height-offset-(border*3)-hz)+'px;left:'+border+'px;width:'+(width-offset-(2*border))+'px;height:'+hz+'px;"><v:fill method="sigma" type="gradient" angle="0" color="#ffffff" opacity="'+(opacity*0.75)+'" color2="#ffffff" o:opacity2="0" /></v:rect><v:rect strokeweight="2" filled="f" stroked="t" strokecolor="'+color+'" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+border+'px;left:'+border+'px;width:'+(width-offset-(2*border))+'px;height:'+(height-offset-(4*border))+'px;"><v:fill color="#ffffff" opacity="0" /></v:rect>';
- 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 74.
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
shade = '<v:rect strokeweight="0" filled="'+f+'" stroked="f" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+db+'px;left:'+db+'px;width:'+(width-offset-(2*border))+'px;height:'+hz+'px;"><v:fill method="sigma" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+(opacity/2)+'" /></v:rect><v:rect strokeweight="0" filled="'+f+'" stroked="f" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+(height-offset-border-hz)+'px;left:'+border+'px;width:'+(width-offset-(2*border))+'px;height:'+hz+'px;"><v:fill method="sigma" type="gradient" angle="0" color="#ffffff" opacity="'+(opacity*0.75)+'" color2="#ffffff" o:opacity2="0" /></v:rect><v:rect strokeweight="2" filled="f" stroked="t" strokecolor="'+color+'" fillcolor="transparent" style="zoom:1;margin:0px;padding:0px;display:block;position:absolute;top:'+border+'px;left:'+border+'px;width:'+(width-offset-(2*border))+'px;height:'+(height-offset-(2*border))+'px;"><v:fill color="#ffffff" opacity="0" /></v:rect>';
- 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 74.
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 _setFormat
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function _setFormat($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method _setFormat
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _setFormat($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
Function _set_navigation
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _set_navigation() {
$('#lightbox-nav').show();
// Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
Function __toString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function __toString()
{
$hour = substr($this->getValue(), 0, 2);
if ($hour >= 12) {
$ampm = 'pm';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setVideoVersions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function setVideoVersions($video, $entry, $namespaces)
{
$ns_media = $entry->children($namespaces['media']);
$versions = $ns_media->group->content;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method FeedDate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FeedDate($dateString="") {
if ($dateString=="") $dateString = date("r");
if (is_numeric($dateString)) {
$this->unix = $dateString;
Similar blocks of code found in 2 locations. Consider refactoring. Open
if(width>height) {
ff=(height/width); xo=0; yo=((ww*ff)-hh)/2; hh=(ww*ff); yo=(yo/(hh/100));
}else if(width<height) {
ff=(width/height); yo=0; xo=((hh*ff)-ww)/2; ww=(hh*ff); xo=(xo/(ww/100));
}else {
- 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 67.
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(width<height) {
ff=(width/height); yo=0; xo=((hh*ff)-ww)/2; ww=(hh*ff); xo=(xo/(ww/100));
}else {
ff=1; xo=0; yo=0;
}
- 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 67.
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 objectToArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function objectToArray($item)
{
if (is_object($item)) {
$itemResult = array();
$ref = new \ReflectionClass($item);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function createFeed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function createFeed() {
$feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
$feed.= $this->_createGeneratorComment();
$feed.= $this->_createStylesheetReferences();
$feed.= "<feed xmlns=\"http://www.w3.org/2005/Atom\"";
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function client_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function client_data(info) {
if (info == 'width') {
width = (screen.width) ? screen.width : '';
height = (screen.height) ? screen.height : '';
width_height_html = width + " x " + height + " pixels";
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ___getPageSize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ___getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
Method _connect
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _connect(&$fp)
{
if(!empty($this->proxy_host) && !empty($this->proxy_port))
{
$this->_isproxy = true;
Method _setMIME
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _setMIME($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
Function _resize_container_image_box
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _resize_container_image_box(intImageWidth,intImageHeight) {
// Get current width and height
var intCurrentWidth = $('#lightbox-container-image-box').width();
var intCurrentHeight = $('#lightbox-container-image-box').height();
//Adjust the image size to fit within the viewport
Function qp_enc
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function qp_enc($input = "", $line_max = 76) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split("/(?:\r\n|\r|\n)/", $input);
$eol = "\r\n";
$escape = "=";
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function checkAdditionalRequirements
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function checkAdditionalRequirements()
{
$status = "good";
$msg = "Image passed image specific requirements";
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_item_version
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function get_item_version( $pv_browser_user_agent, $pv_search_string, $pv_b_break_last='', $pv_extra_search='' )
{
// 12 is the longest that will be required, handles release dates: 20020323; 0.8.0+
$substring_length = 15;
$start_pos = 0; // set $start_pos to 0 for first iteration
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"