civictechro/fiipregatit.ro

View on GitHub

Showing 53 of 53 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

  use Roots\Sage\Assets;

  final class AboutMetaGenerator extends MetaGenerator {
Severity: Major
Found in site/web/app/themes/sage/lib/Meta/AboutMetaGenerator.php and 2 other locations - About 1 day to fix
site/web/app/themes/sage/lib/Meta/FirstAidMetaGenerator.php on lines 1..70
site/web/app/themes/sage/lib/Meta/PersonalPlanMetaGenerator.php on lines 1..70

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 313.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

  use Roots\Sage\Assets;

  final class PersonalPlanMetaGenerator extends MetaGenerator {
site/web/app/themes/sage/lib/Meta/AboutMetaGenerator.php on lines 1..70
site/web/app/themes/sage/lib/Meta/FirstAidMetaGenerator.php on lines 1..70

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 313.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

  use Roots\Sage\Assets;

  final class FirstAidMetaGenerator extends MetaGenerator {
Severity: Major
Found in site/web/app/themes/sage/lib/Meta/FirstAidMetaGenerator.php and 2 other locations - About 1 day to fix
site/web/app/themes/sage/lib/Meta/AboutMetaGenerator.php on lines 1..70
site/web/app/themes/sage/lib/Meta/PersonalPlanMetaGenerator.php on lines 1..70

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 313.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      return (new FirstAid($this->wpObject->ID))
        ->setArsuraCopii(get_field('arsura_la_copii', $this->wpObject->ID))
        ->setIntoxicatiaAlcoolica(
          get_field('intoxicatia_alcoolica', $this->wpObject->ID)
        )
Severity: Major
Found in site/web/app/lib/CustomPage/FirstAidPage.php and 1 other location - About 1 day to fix
site/web/app/lib/CustomPage/PersonalPlanPage.php on lines 10..42

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 252.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      return (new PersonalPlan($this->wpObject->ID))
        ->setApa(get_field('apa', $this->wpObject->ID))
        ->setAlimente(get_field('alimente', $this->wpObject->ID))
        ->setImbracaminteSiIncaltaminte(
          get_field('imbracaminte_si_incaltaminte', $this->wpObject->ID)
Severity: Major
Found in site/web/app/lib/CustomPage/PersonalPlanPage.php and 1 other location - About 1 day to fix
site/web/app/lib/CustomPage/FirstAidPage.php on lines 10..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 252.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method _registerCustomMetaBox has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _registerCustomMetaBox() {
      $custom_boxes_init = function() {
        // Custom Guides meta box
        $cmb_guide = new_cmb2_box(array(
            'id'            => 'galerie_foto_ghiduri',
Severity: Major
Found in site/web/app/mu-plugins/fiipregatit-content.php - About 5 hrs to fix

    FirstAid has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    final class FirstAid extends Entity {
      private $arsuraCopii;
      private $apel112;
      private $intoxicatieAlcoolica;
      private $muscaturiAnimal;
    Severity: Minor
    Found in site/web/app/lib/Entity/FirstAid.php - About 3 hrs to fix

      Guide has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      final class Guide extends Entity {
        private $title;
        private $nume;
        private $inainteaEvenimentului;
        private $inTimpulEvenimentului;
      Severity: Minor
      Found in site/web/app/lib/Entity/Guide.php - About 3 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public function getTagPairs(
              /* OpenGraphMetaCategories */ string $category
            ): /* Pair */ ?array {
              if (!isset($this->getRawTags()[$category])) {
                return null;
        site/web/app/themes/sage/lib/Meta/Decorators/OpenGraphMetaDecorator.php on lines 32..57

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 144.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public function getTagPairs(
              /* OpenGraphMetaCategories */ string $category
            ): /* Pair */ ?array {
              if (!isset($this->getRawTags()[$category])) {
                return null;
        site/web/app/themes/sage/lib/Meta/Decorators/MetaMetaDecorator.php on lines 25..50

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 144.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
        
        use CustomPage\PersonalPlanPage;
        use CustomPage\FirstAidPage;
        use CustomPage\AboutPage;
        Severity: Major
        Found in site/web/app/lib/CustomPageManager.php and 1 other location - About 3 hrs to fix
        site/web/app/lib/RepoManager.php on lines 1..38

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 143.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
        use Repository\GuideRepository;
        use Repository\CampaignRepository;
        use Repository\LinkRepository;
        
        
        Severity: Major
        Found in site/web/app/lib/RepoManager.php and 1 other location - About 3 hrs to fix
        site/web/app/lib/CustomPageManager.php on lines 1..40

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 143.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        PersonalPlan has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        final class PersonalPlan extends Entity {
          private $apa;
          private $alimente;
          private $imbracaminteSiIncaltaminte;
          private $sacDeDormit;
        Severity: Minor
        Found in site/web/app/lib/Entity/PersonalPlan.php - About 2 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          foreach ($guides as $guide) {
            $guideProps[] = array(
              'icon' => $guide->getPictograma()->getUrl(),
              'title' => $guide->getTitle(),
              'permalink' => $guide->getPermalink(),
          Severity: Major
          Found in site/web/app/themes/sage/templates/listing-ghiduri.php and 1 other location - About 2 hrs to fix
          site/web/app/themes/sage/templates/content-single-ghid.php on lines 92..104

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 128.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            foreach ($recommendedGuides as $guide) {
              $guideProps[] = array(
                'icon' => $guide->getPictograma()->getUrl(),
                'title' => $guide->getTitle(),
                'permalink' => $guide->getPermalink(),
          Severity: Major
          Found in site/web/app/themes/sage/templates/content-single-ghid.php and 1 other location - About 2 hrs to fix
          site/web/app/themes/sage/templates/listing-ghiduri.php on lines 18..30

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 128.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                return $this->entity->getApa() . ' '
                  . $this->entity->getAlimente() . ' '
                  . $this->entity->getImbracaminteSiIncaltaminte() . ' '
                  . $this->entity->getSacDeDormit() . ' '
                  . $this->entity->getTrusaPrimAjutor() . ' '
          site/web/app/themes/sage/lib/Algolia/FirstAidIndexCustomFields.php on lines 15..24

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 123.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                return $this->entity->getArsuraCopii() . ' '
                . $this->entity->getApel112() . ' '
                . $this->entity->getIntoxicatieAlcoolica() . ' '
                . $this->entity->getMuscaturiAnimal() . ' '
                . $this->entity->getObstructieCaiAeriene() . ' '
          site/web/app/themes/sage/lib/Algolia/PersonalPlanIndexCustomFields.php on lines 16..25

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 123.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

            foreach ($guides as $guide) {
              $guideProps[] = array(
                'icon' => $guide->getPictograma()->getUrl(),
                'title' => $guide->getTitle(),
                'permalink' => $guide->getPermalink(),
          Severity: Major
          Found in site/web/app/themes/sage/front-page.php and 2 other locations - About 1 hr to fix
          site/web/app/themes/sage/templates/content-prim-ajutor.php on lines 102..113
          site/web/app/themes/sage/templates/content-single-campanie.php on lines 70..81

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

            foreach ($guides as $guide) {
              $guideProps[] = array(
                'icon' => $guide->getPictograma()->getUrl(),
                'title' => $guide->getTitle(),
                'permalink' => $guide->getPermalink(),
          site/web/app/themes/sage/front-page.php on lines 17..28
          site/web/app/themes/sage/templates/content-prim-ajutor.php on lines 102..113

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          foreach ($guides as $guide) {
            $guideProps[] = array(
              'icon' => $guide->getPictograma()->getUrl(),
              'title' => $guide->getTitle(),
              'permalink' => $guide->getPermalink(),
          Severity: Major
          Found in site/web/app/themes/sage/templates/content-prim-ajutor.php and 2 other locations - About 1 hr to fix
          site/web/app/themes/sage/front-page.php on lines 17..28
          site/web/app/themes/sage/templates/content-single-campanie.php on lines 70..81

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language