Showing 265 of 306 total issues
Function registerEventListeners
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function registerEventListeners(DispatcherContract $events)
{
foreach ($this->listen as $event => $listeners) {
$defaultPriority = 0;
if (!is_array($listeners)) {
- 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 resolveNamespace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function resolveNamespace(string $path, bool $asPackage = false): string
{
$file = new File($path);
$pathInfo = array_filter(explode(DIRECTORY_SEPARATOR, trim(str_replace([$this->configRepository->getRootPath(), 'src'], '', $file->getRealPath()), DIRECTORY_SEPARATOR)));
$prefix = 'antares';
- 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 min
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function min()
{
if ($this->output !== '') { // min already run
return $this->output;
}
Method columnSearch
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function columnSearch()
{
$columns = $this->request->get('columns', []);
foreach ($columns as $index => $column) {
Method getActionsColumn
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getActionsColumn(Authorization $acl): Closure
{
return function(ExtensionContract $extension) use($acl) {
$buttons = [];
$name = $extension->getPackage()->getName();
Method setDefaultOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setDefaultOptions()
{
$areas = array_keys(config('areas.areas'));
$default = config('areas.default');
$configuration = require_once(__DIR__ . '/../../../../../modules/brands/resources/config/install.php');
Method registerEngine
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function registerEngine()
{
$this->app->bindIf('twig', function () {
$extensions = $this->app->make('twig.extensions');
$lexer = $this->app->make('twig.lexer');
Method render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$dropzoneAttributes = array_diff_key($this->field->attributes, array_flip(['class']));
if (!isset($dropzoneAttributes['container'])) {
Method argumentsToString
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function argumentsToString($args)
{
$count = 0;
$isAssoc = $args !== array_values($args);
Method decorate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function decorate($value, $safe = false)
{
if (is_string($value)) {
if (strpos($value, 'js:') === 0 && $safe === false)
return substr($value, 3);
Function getPatterned
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getPatterned($value)
{
if (!is_array($value)) {
return str_replace('%value', ucfirst($value), $this->pattern);
} else {
- 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 requireJs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function requireJs()
{
$scripts = $this->dispatcher->scripts('script', $this->assets, $this->path);
$required = [];
- 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 beforeTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function beforeTable()
{
$hasMassActions = $this->hasMassActions();
$filters = $this->filterAdapter->getFilters();
$hasColumnFilter = $this->hasColumnFilter();
- 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 findExtensions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function findExtensions(): Extensions
{
$extensions = new Extensions();
- 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 smtp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function smtp(array $data = null)
{
$valid = true;
foreach (['email_address', 'email_host', 'email_port', 'email_username', 'email_password', 'email_encryption'] as $key) {
Method run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(OperationHandlerContract $handler, ExtensionContract $extension, array $flags = []) {
try {
$name = $extension->getPackage()->getName();
if($this->componentsRepository->isRequired($name)) {
Method customfieldsByFieldset
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function customfieldsByFieldset($grid, $name)
{
if (!extension_active('customfields')) {
return;
}
Method up
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::transaction(function() {
$datetime = Carbon::now();
DB::table('tbl_roles')->insert([
Method adapt
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function adapt(Grid &$grid)
{
$this->grid = $grid;
$customfields = app('customfields')->get();
if (empty($customfields)) {
Method up
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
$this->down();
Schema::create('tbl_brand_options', function(Blueprint $table) {
$table->increments('id')->unsigned();