civictechro/fiipregatit.ro

View on GitHub

Showing 53 of 53 total issues

Avoid too many return statements within this method.
Open

    return __('Not Found', 'sage');
Severity: Major
Found in site/web/app/themes/sage/lib/titles.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return get_the_title();
    Severity: Major
    Found in site/web/app/themes/sage/lib/titles.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

          return null;
      Severity: Major
      Found in site/web/app/lib/Entity/Guide.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                  return new AboutMetaGenerator(
                    $post,
                    \CustomPageManager::getAboutPage()->getPage()
                  );
        Severity: Major
        Found in site/web/app/themes/sage/lib/Meta/MetaGenerator.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                return new GenericMetaGenerator($post);
          Severity: Major
          Found in site/web/app/themes/sage/lib/Meta/MetaGenerator.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                      return new AboutIndexCustomFields(
                        $attributes,
                        \CustomPageManager::getAboutPage()->getPage()
                      );
            Severity: Major
            Found in site/web/app/themes/sage/lib/Algolia/IndexCustomFields.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return new NoOpIndexCustomFields($attributes);
              Severity: Major
              Found in site/web/app/themes/sage/lib/Algolia/IndexCustomFields.php - About 30 mins to fix

                Function getAllTagPairs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getAllTagPairs(): /* array<Pair>*/ array {
                      $flat_list = array();
                      foreach(OpenGraphMetaCategory::getList() as $category) {
                        $pairs = $this->getTagPairs($category);
                        if (!$pairs) {
                Severity: Minor
                Found in site/web/app/themes/sage/lib/Meta/Decorators/OpenGraphMetaDecorator.php - About 25 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 getAllTagPairs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getAllTagPairs(): /* array<Pair>*/ array {
                      $flat_list = array();
                      foreach(MetaMetaCategory::getList() as $category) {
                        $pairs = $this->getTagPairs($category);
                        if (!$pairs) {
                Severity: Minor
                Found in site/web/app/themes/sage/lib/Meta/Decorators/MetaMetaDecorator.php - About 25 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 getPDFGuideSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getPDFGuideSize(): ?string {
                    if (!$this->guidePDF || !$this->guidePDF['url']) {
                      return null;
                    }
                
                
                Severity: Minor
                Found in site/web/app/lib/Entity/Guide.php - About 25 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 getOGPImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getOGPImage(): array {
                      $image = null;
                
                      if ($this->post) {
                        switch($this->post->post_name) {
                Severity: Minor
                Found in site/web/app/themes/sage/lib/Meta/GenericMetaGenerator.php - About 25 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 getPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function getPath($key = '', $default = null) {
                    $collection = $this->manifest;
                    if (is_null($key)) {
                      return $collection;
                    }
                Severity: Minor
                Found in site/web/app/themes/sage/lib/assets.php - About 25 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 body_class has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function body_class($classes) {
                  // Add page slug if it doesn't exist
                  if (is_single() || is_page() && !is_front_page()) {
                    if (!in_array(basename(get_permalink()), $classes)) {
                      $classes[] = basename(get_permalink());
                Severity: Minor
                Found in site/web/app/themes/sage/lib/extras.php - About 25 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