Showing 617 of 617 total issues
Function updateNavArrows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateNavArrows: function() {
if (!this._allow_update)
return;
var d = new Date(this.viewDate),
- Create a ticketCreate a ticket
Function loadConversations
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadConversations() {
sendRequest({}, "messages", "load", function (res) {
if (typeof res.conversations !== "undefined" && res.conversations !== null && res.conversations.length > 0) {
$(".inbox-empty,.inbox-loader").hide();
$(".inbox-item").remove();
- Create a ticketCreate a ticket
Method loadData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadData()
{
$statisticData = [];
$statistics = new \Cunity\Admin\Models\Db\Table\Statistics();
$data = $statistics->getLastMonths();
- Create a ticketCreate a ticket
Method crop
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function crop($x, $y, $x1, $y1, $file, $target, $thumbwidth)
{
list(, , $type) = getimagesize($file);
$source = false;
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
$query = $this->getAdapter()->select()->from(['p' => $this->_dbprefix.'posts'])
->join(['w' => $this->getTableName()], 'w.wall_id=p.wall_id')
->join(['u' => $this->_dbprefix.'users'], 'u.userid=p.userid', ['name', 'username'])
->joinLeft(['img' => $this->_dbprefix.'gallery_images'], "img.id=p.content AND p.type = 'image'", ['filename', 'caption', 'id AS refid'])
->joinLeft(['rus' => $this->_dbprefix.'users'], "rus.userid=w.owner_id AND p.userid != w.owner_id AND w.owner_type = 'profile'", ['name AS receivername', 'username AS receiverusername'])
- Read upRead up
- Create a ticketCreate a ticket
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 109.
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
$query = $this->getAdapter()->select()->from(['p' => $this->_dbprefix.'posts'])
->join(['w' => $this->getTableName()], 'w.wall_id=p.wall_id')
->join(['u' => $this->_dbprefix.'users'], 'u.userid=p.userid', ['name', 'username'])
->joinLeft(['img' => $this->_dbprefix.'gallery_images'], "img.id=p.content AND p.type = 'image'", ['filename', 'caption', 'id AS refid'])
->joinLeft(['rus' => $this->_dbprefix.'users'], "w.owner_type = 'profile' AND rus.userid=w.owner_id AND p.userid != w.owner_id AND w.owner_id != ".$ownerid, ['name AS receivername', 'username AS receiverusername'])
- Read upRead up
- Create a ticketCreate a ticket
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 109.
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 handleRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function handleRequest()
{
switch (Request::get('action')) {
case 'sendTestMail':
$mail = new Mail();
- Read upRead up
- Create a ticketCreate a ticket
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 login
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function login()
{
if (Post::get('email') === null || Post::get('password') === null) {
throw new MissingParameter();
}
- Read upRead up
- Create a ticketCreate a ticket
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 o
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function o(o) {
function a() {
for (var e = 0, t, n; e <= u.length;) {
if (t = c.SHORT(e += 2), t >= 65472 && 65475 >= t)return e += 5, {
height: c.SHORT(e),
- Create a ticketCreate a ticket
Function monitorSource
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
monitorSource: function () {
var el = this.opts.element, observer, self = this;
el.on("change.select2", this.bind(function (e) {
if (this.opts.element.data("select2-change-triggered") !== true) {
- Create a ticketCreate a ticket
Function _day
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Calendar.prototype._day = function(week, day) {
this._loadTemplate('month-day');
var t = {tooltip: '', cal: this};
var cls = this.options.classes.months.outmonth;
- Create a ticketCreate a ticket
Identical blocks of code found in 3 locations. Consider refactoring. Open
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
$(this).siblings().removeClass("active");
$(e.target).addClass("active");
});
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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 3 locations. Consider refactoring. Open
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
$(this).siblings().removeClass("active");
$(e.target).addClass("active");
});
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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 3 locations. Consider refactoring. Open
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
$(this).siblings().removeClass("active");
$(e.target).addClass("active");
});
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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 success
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function () {
uploader = new plupload.Uploader({
runtimes: 'html5,flash,silverlight,html4',
browse_button: 'title-upload',
multi_selection: false,
- Create a ticketCreate a ticket
Method thumbnail
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function thumbnail($file, $target, $thumbwidth)
{
list($width, $height, $type) = getimagesize($file);
$source = false;
- Create a ticketCreate a ticket
Method reset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reset()
{
$error_messages = [];
$view = new ResetPassword();
if (Post::get() !== null) {
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
setTimeout: function (a, b, c) {
var d = this;
return a && window.setTimeout(function () {
a.apply(d, b || [])
}, c || 0)
- Read upRead up
- Create a ticketCreate a ticket
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 62.
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
onslide: function (a) {
this.index = a, this.handleSlide(a), this.setTimeout(this.options.onslide, [a, this.slides[a]])
},
- Read upRead up
- Create a ticketCreate a ticket
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 62.
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
setTimeout: function (a, b, c) {
var d = this;
return a && window.setTimeout(function () {
a.apply(d, b || [])
}, c || 0)
- Read upRead up
- Create a ticketCreate a ticket
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 62.
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