Showing 749 of 749 total issues
Avoid too many return
statements within this method. Open
return Effect::new()->api(true, "malware listing", ["compressed" => false, "malware" => $malware, "file_path" => $request->post["file_path"]]);
Similar blocks of code found in 2 locations. Consider refactoring. Open
d.hunks.push(k(o,m)),e++,n+=o.newLines-o.oldLines;else if(j(p,o))
// This patch does not overlap with any of the others, yay.
d.hunks.push(k(p,n)),f++,m+=p.newLines-p.oldLines;else{
// Overlap, merge as best we can
var q={oldStart:Math.min(o.oldStart,p.oldStart),oldLines:0,newStart:Math.min(o.newStart+m,p.oldStart+n),newLines:0,lines:[]};l(q,o.oldStart,o.lines,p.oldStart,p.lines),f++,e++,d.hunks.push(q)}}return d}function g(a,b){if("string"==typeof a){if(/^@@/m.test(a)||/^Index:/m.test(a))/*istanbul ignore start*/
- 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 45.
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
Avoid too many return
statements within this function. Open
if (aStack[length] === a) return bStack[length] === b;
Avoid too many return
statements within this method. Open
return $carry . " <a style='float:left' href='$item' target='_blank'>$item</a><br>";
Avoid too many return
statements within this method. Open
return UA_NO_MATCH;
Avoid too many return
statements within this method. Open
return unlink($this->key2name($key_name));
Avoid too many return
statements within this method. Open
return $effect->out($path . "config.ini")->hide_output();
Avoid too many return
statements within this method. Open
return Effect::new()->api(false, "invalid file: $path");
Avoid too many return
statements within this method. Open
return $carry;
Avoid too many return
statements within this method. Open
return $effect;
Avoid too many return
statements within this method. Open
return debugF("unable to write header key: [%s] [%d] bytes", $key, $size);
Avoid too many return
statements within this method. Open
if ($ex_class === $bl_class) { return NULL; }
Avoid too many return
statements within this method. Open
return ["content" => "", "length" => 0, "success" => false];
Similar blocks of code found in 2 locations. Consider refactoring. Open
d.oldFileName=b.oldFileName||a.oldFileName,d.newFileName=b.newFileName||a.newFileName,d.oldHeader=b.oldHeader||a.oldHeader,d.newHeader=b.newHeader||a.newHeader)),d.hunks=[];for(var e=0,f=0,m=0,n=0;e<a.hunks.length||f<b.hunks.length;){var o=a.hunks[e]||{oldStart:1/0},p=b.hunks[f]||{oldStart:1/0};if(j(o,p))
// This patch does not overlap with any of the others, yay.
d.hunks.push(k(o,m)),e++,n+=o.newLines-o.oldLines;else if(j(p,o))
// This patch does not overlap with any of the others, yay.
d.hunks.push(k(p,n)),f++,m+=p.newLines-p.oldLines;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 45.
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
Avoid too many return
statements within this method. Open
return $bot;
Avoid too many return
statements within this method. Open
return $carry;
Avoid too many return
statements within this method. Open
return $m;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;