antaresproject/core

View on GitHub

Showing 265 of 306 total issues

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

    protected function show($param, $type = null, $width = 40, $height = 40, $widget = false)
    {
        $filename = public_path('avatars/' . implode('_', [$type, (is_numeric($param) ? $param : camel_case($param)), $width, $height]) . '.png');
        if (!$this->filesystem->exists(dirname($filename))) {
            $this->filesystem->makeDirectory(dirname($filename));
Severity: Minor
Found in src/utils/twig/Extension/Avatar.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 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 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 parsePackage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parsePackage($attribute, UploadedFile $value, $parameters)
    {
        $name            = $value->getClientOriginalName();
        $this->directory = $directory       = $value->directory;
        $this->filename  = $filename        = $value->filename;
Severity: Minor
Found in src/foundation/src/Traits/PackageValidationTrait.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 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 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 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 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 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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function add(&$attributes, $actions)
    {
        $index  = 0;
        $childs = [];
        foreach ($actions as $name => $callback) {
Severity: Minor
Found in src/foundation/src/Listeners/BreadcrumbsMenuDependableActions.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 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function run($path)
    {

        $this->createMigrationRepository();
        $repository = $this->migrator->getRepository();
Severity: Minor
Found in src/components/publisher/src/MigrateManager.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