Showing 306 of 306 total issues
Function getRecipients
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getRecipients()
{
if (empty($this->recipients)) {
return [];
}
- 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
File Fieldset.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Method updatePermissions
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updatePermissions($name, $values, $isNew = false, $brandId = null)
{
try {
if ($name === null) {
return false;
Method up
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
$this->down();
Schema::create('tbl_notifications', function(Blueprint $table) {
File JSMin.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
File Foundation.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Fieldset
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Fieldset extends BaseGrid implements FieldsetContract
{
/**
* Fieldset name.
HtmlBuilder
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class HtmlBuilder
{
use Macroable,
ObfuscateTrait;
AbstractNotificationTemplate
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractNotificationTemplate extends Job implements NotificationContract, ShouldQueue
{
use InteractsWithQueue,
SerializesModels;
Function verify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function verify(array $items = [], $brandId = null)
{
$items = $this->clear($items);
$changed = [];
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
Schema::table('tbl_brand_options', function(Blueprint $table) {
$table->foreign('brand_id', 'tbl_brand_options_ibfk_1')->references('id')->on('tbl_brands')->onUpdate('NO ACTION')->onDelete('CASCADE');
$table->foreign('country_id', 'tbl_brand_options_ibfk_2')->references('id')->on('tbl_country')->onUpdate('NO ACTION')->onDelete('CASCADE');
$table->foreign('language_id', 'tbl_brand_options_ibfk_3')->references('id')->on('tbl_languages')->onUpdate('NO ACTION')->onDelete('CASCADE');
});
- 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 132.
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
Schema::table('tbl_notifications', function(Blueprint $table) {
$table->foreign('severity_id', 'fk_severity_id')->references('id')->on('tbl_notification_severity')->onUpdate('NO ACTION')->onDelete('CASCADE');
$table->foreign('category_id', 'fk_not_category_id')->references('id')->on('tbl_notification_categories')->onUpdate('NO ACTION')->onDelete('CASCADE');
$table->foreign('type_id', 'fk_not_type_id')->references('id')->on('tbl_notification_types')->onUpdate('NO ACTION')->onDelete('CASCADE');
});
- 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 132.
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
File User.php
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Function attributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function attributes(FieldView $field)
{
if (is_null($field)) {
return $this;
}
- 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 wrap_html
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function wrap_html($str, $size = 50, $splitter = '<br />')
{
$html = false;
$i = 0;
$chars = str_split($str);
- 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 attributes
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function attributes(FieldView $field)
{
if (is_null($field)) {
return $this;
}
Method inline
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function inline()
{
$inline = <<<EOD
$(document).ready(function(){
var element =null;
Method beforeTable
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function beforeTable()
{
$hasMassActions = $this->hasMassActions();
$filters = $this->filterAdapter->getFilters();
$hasColumnFilter = $this->hasColumnFilter();
Method up
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
try {
$this->down();
Schema::create('tbl_log_priorities', function(Blueprint $table) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function finish(array $items = [])
{
$changed = false;
foreach ($items as $key => $value) {
$isNew = $this->isNewKey($key);
- 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 125.
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