antaresproject/core

View on GitHub

Showing 306 of 306 total issues

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 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 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

Avoid too many return statements within this method.
Open

        return [$str, $array, $serializable, $stringify, $jsonable];
Severity: Major
Found in src/utils/twig/Extension/Foundation.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $classname;
    Severity: Major
    Found in src/ui/components/templates/src/Twig/Component.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return 'Number.POSITIVE_INFINITY';
      Severity: Major
      Found in src/utils/asset/src/JavaScriptDecorator.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return true;
        Severity: Major
        Found in src/utils/asset/src/JSMin.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $meta->value;
          Severity: Major
          Found in src/utils/twig/Extension/Avatar.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return Gravatar::src($email, $width);
            Severity: Major
            Found in src/utils/twig/Extension/Avatar.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return self::decorate(get_object_vars($value), $safe);
              Severity: Major
              Found in src/utils/asset/src/JavaScriptDecorator.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                    return;
                Severity: Major
                Found in src/utils/twig/Extension/Foundation.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return '[' . implode(',', $es) . ']';
                  Severity: Major
                  Found in src/utils/asset/src/JavaScriptDecorator.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return $value;
                    Severity: Major
                    Found in src/utils/twig/Extension/Foundation.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return new Twig_SimpleFunction(
                                      'component_attributes', $function
                              );
                      Severity: Major
                      Found in src/ui/components/templates/src/Twig/Component.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return "$value";
                        Severity: Major
                        Found in src/utils/asset/src/JavaScriptDecorator.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return $value->__toString();
                          Severity: Major
                          Found in src/utils/asset/src/JavaScriptDecorator.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return Gravatar::src($email, $width);
                            Severity: Major
                            Found in src/utils/twig/Extension/Avatar.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return [
                                          $avatar, $avatarWidget, $gravatar, $profilePicture
                                      ];
                              Severity: Major
                              Found in src/utils/twig/Extension/Avatar.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return '';
                                Severity: Major
                                Found in src/utils/twig/Extension/Foundation.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return $return;
                                  Severity: Major
                                  Found in src/utils/asset/src/AssetPublisher.php - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language