antaresproject/core

View on GitHub

Showing 306 of 306 total issues

Function componentAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function componentAttributes()
    {
        $function = function ($widget) {
            $classname = array_get($widget['attributes'], 'attributes.classname');
            if (is_null($classname)) {
Severity: Minor
Found in src/ui/components/templates/src/Twig/Component.php - About 35 mins to fix

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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get()
    {
        $c               = $this->lookAhead;
        $this->lookAhead = null;
        if ($c === null) {
Severity: Minor
Found in src/utils/asset/src/JSMin.php - About 35 mins to fix

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 getCustomfields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCustomfields()
    {
        $extensions = extensions();
        $return     = [];
        event('customfields.before.search', $return);
Severity: Minor
Found in src/components/html/src/CustomfieldsFinder.php - About 35 mins to fix

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 componentForced has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function componentForced()
    {
        $function = function ($name = null, array $params = []) {

            if (is_null($name)) {
Severity: Minor
Found in src/ui/components/templates/src/Twig/Component.php - About 35 mins to fix

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 getFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getFiles($specified)
    {
        $specified = (array) $specified;

        if (php_sapi_name() === 'cli') {
Severity: Minor
Found in src/utils/asset/src/AssetPublisher.php - About 35 mins to fix

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 registerRouteMiddleware has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function registerRouteMiddleware(Router $router, Kernel $kernel)
    {


        foreach ((array) $this->middleware as $middleware) {
Severity: Minor
Found in src/components/support/src/Providers/Traits/MiddlewareProviderTrait.php - About 35 mins to fix

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 publish has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function publish($extension, $options = null, $before = [])
    {
        $this->extension = $extension;

        $params = is_string($options) ? config('antares/' . $extension . '::' . $options) : $options;
Severity: Minor
Found in src/utils/asset/src/AssetPublisher.php - About 35 mins to fix

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 componentsList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function componentsList()
    {
        $function = function () {

            $widgets = app('antares.widget')->make('menu.top.right')->items();
Severity: Minor
Found in src/ui/components/templates/src/Twig/Component.php - About 35 mins to fix

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 addColumn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function addColumn(array $attributes)
    {
        $query  = $this->getQuery();
        $orders = $query instanceof \Illuminate\Database\Eloquent\Builder ? $query->getQuery()->orders : null;
        if (!isset($this->attributes['order']) and ! is_null($query) and ! is_null($orders)) {
Severity: Minor
Found in src/ui/components/datatables/src/Html/Builder.php - About 35 mins to fix

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 getVariables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getVariables()
    {
        $variables  = Notification::getInstance()->all();
        $extensions = app()->make('antares.memory')->make('component')->get('extensions.active');

Severity: Minor
Found in src/components/view/src/Notification/AbstractNotificationTemplate.php - About 35 mins to fix

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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function save($key, $value, $isNew = false, $brandId = false, $flag = null)
    {
        try {
            DB::transaction(function () use ($key, $value, $isNew, $brandId, $flag) {
                $name = str_replace('acl_antares/', '', $key);
Severity: Minor
Found in src/components/memory/src/Handlers/Component.php - About 35 mins to fix

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 handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle(Manager $manager, Container $container)
    {
        $output     = new OperationFileOutput($this->outputFileName);
        $extension  = $manager->getAvailableExtensions()->findByName($this->extensionName);

Severity: Minor
Found in src/components/extension/src/Jobs/ExtensionsBackgroundJob.php - About 35 mins to fix

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 checkAuthorization has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkAuthorization($roles, $action)
    {
        $action = $this->actions->search($action);

        if ($action === null) {
Severity: Minor
Found in src/components/auth/src/Authorization/AuthorizationTrait.php - About 35 mins to fix

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 finish has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function finish()
    {

        foreach ($this->drivers as $name => $class) {
            $handler = $class->getHandler();
Severity: Minor
Found in src/components/memory/src/MemoryManager.php - About 35 mins to fix

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 prepareValidRoute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function prepareValidRoute($route, $item, $query, array $options)
    {
        if (!!Arr::get($options, 'csrf', false)) {
            $query .= (!empty($query) ? '&' : '' ) . '_token=' . $this->app->make('session')->token();
            unset($options['csrf']);
Severity: Minor
Found in src/components/kernel/src/Http/RouteManager.php - About 35 mins to fix

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 createAdminMenu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function createAdminMenu()
    {
        $config = config('menu');
        $events = $this->app->make('events');
        foreach ($config as $event => $ordered) {
Severity: Minor
Found in src/foundation/src/Foundation.php - About 35 mins to fix

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 params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function params()
    {
        $params = array_get(debug_backtrace(0, 3), '2.args.1');
        $return = [];
        foreach ($params as $model) {
Severity: Minor
Found in src/foundation/src/Template/CustomNotification.php - About 35 mins to fix

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 getScriptsContainers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function getScriptsContainers()
    {
        $container = null;
        $config    = null;
        foreach (['container', 'app', 'foundation'] as $name) {
Severity: Minor
Found in src/foundation/src/Http/Presenters/Presenter.php - About 35 mins to fix

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 addContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addContent($message, $view, $plain, $raw, $data)
    {

        if (isset($view)) {
            if (is_string($view)) {
Severity: Minor
Found in src/components/notifier/src/Mail/Mailer.php - About 35 mins to fix

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 getValidationRules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getValidationRules($inputName, $validator)
    {
        $validator->onUpload();
        $rules      = $validator->getValidationRules();
        $attributes = [];
Severity: Minor
Found in src/foundation/src/Http/Presenters/DropzoneTrait.php - About 35 mins to fix

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

Severity
Category
Status
Source
Language