civictechro/website-alba-iulia-smart-city

View on GitHub

Showing 73 of 73 total issues

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

    register_post_type(
      AppConstants::POST_TYPE_VERTICAL,
      array(
        'labels' => array(
          'name' => __('Verticale'),
Severity: Major
Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 4 other locations - About 3 hrs to fix
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 219..237
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 239..257
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 279..297
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 299..317

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

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 5 locations. Consider refactoring.
Open

    register_post_type(
      AppConstants::POST_TYPE_PROJECT_LABEL,
      array(
        'labels' => array(
          'name' => __('Etichete proiect'),
Severity: Major
Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 4 other locations - About 3 hrs to fix
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 219..237
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 259..277
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 279..297
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 299..317

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

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 5 locations. Consider refactoring.
Open

    register_post_type(
      AppConstants::POST_TYPE_COMPANY,
      array(
        'labels' => array(
          'name' => __('Companii'),
Severity: Major
Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 4 other locations - About 3 hrs to fix
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 239..257
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 259..277
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 279..297
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 299..317

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

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 5 locations. Consider refactoring.
Open

    register_post_type(
      AppConstants::POST_TYPE_PROJECT_STATUS,
      array(
        'labels' => array(
          'name' => __('Etape proiect'),
Severity: Major
Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 4 other locations - About 3 hrs to fix
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 219..237
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 239..257
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 259..277
site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 299..317

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

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 2 locations. Consider refactoring.
Open

    return array(
      'name' => $project->post_title,
      'verticala' => array(
        'label' => $verticala->post_title,
        'pictograma' => get_field('pictograma_upload', $verticala->ID),
Severity: Major
Found in site/web/app/themes/smart-city/app/controllers/Solutii.php and 1 other location - About 3 hrs to fix
site/web/app/themes/smart-city/app/controllers/front-page.php on lines 25..41

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

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 2 locations. Consider refactoring.
Open

      $ret[] = array(
        'name' => $project->post_title,
        'verticala' => array(
          'label' => $verticala->post_title,
          'pictograma' => get_field('pictograma_upload', $verticala->ID),
site/web/app/themes/smart-city/app/controllers/Solutii.php on lines 45..61

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

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

File contact-content-page.blade.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<div class="container contact">
  <h2>{{ pll__('Vrei să ne transmiți un mesaj?') }}</h2>
  <div class="row">
    <div class="col-md-6 col-sm-12">
        <div class="address">

    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/smart-city/app/meta/decorators/OpenGraphMetaDecorator.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

        public function getTagPairs(
          /* OpenGraphMetaCategories */ string $category
        ): /* Pair */ ?array {
          if (!isset($this->getRawTags()[$category])) {
            return null;
    site/web/app/themes/smart-city/app/meta/decorators/MetaMetaDecorator.php on lines 26..51

    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

    Method registerCustomMetaBoxes has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private function registerCustomMetaBoxes(): void {
        $custom_boxes_init = function() {
          $project_gallery = new_cmb2_box(array(
            'id' => AppConstants::PROJECT_GALLERY_METABOX,
            'title' => __('Galerie Foto', 'cmb2'),
    Severity: Major
    Found in site/web/app/mu-plugins/SmartCityThemeSetup.php - About 2 hrs to fix

      Function init has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        init() {
          $('.furnizori-carousel, .parteneri-carousel').slick({
            //dots: true,
            infinite: true,
            speed: 300,

        Function animate_logo has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function animate_logo() {
              let timeline = anime.timeline();
        
              timeline
                .add({

          Function replace_item_with_key has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          def replace_item_with_key(obj, result):
              item = '_ansible_item_label' if '_ansible_item_label' in result._result else 'item'
              should_replace = (
                  not obj._display.verbosity
                  and 'label' not in result._task._ds.get('loop_control', {})
          Severity: Minor
          Found in trellis/lib/trellis/utils/output.py - About 1 hr 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

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

                  array(
                          'key' => 'field_5a9a5ec18d132',
                          'label' => 'Verticală',
                          'name' => 'verticala',
                          'type' => 'relationship',
          Severity: Major
          Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 1 hr to fix
          site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 807..832

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

          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

                  array(
                    'key' => 'field_5a9a5ec18d131',
                    'label' => 'Etapă implementare',
                    'name' => 'etapa_implementare',
                    'type' => 'relationship',
          Severity: Major
          Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 1 hr to fix
          site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 833..858

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

          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

                      array(
                          'key' => 'field_5a80ade76dfaf',
                          'label' => 'Logo companie',
                          'name' => 'logo',
                          'type' => 'image',
          Severity: Major
          Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 1 hr to fix
          site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 1267..1290

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

          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

                  array(
                      'key' => 'field_5b42ba0be71fa',
                      'label' => 'Pictograma',
                      'name' => 'pictograma_upload',
                      'type' => 'image',
          Severity: Major
          Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 1 hr to fix
          site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 687..710

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

          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 projectData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public static function projectData(\WP_Post $project): array {
              $verticala = get_field('verticala', $project->ID);
              if ($verticala) {
                $verticala = $verticala[0];
              } else {
          Severity: Minor
          Found in site/web/app/themes/smart-city/app/controllers/Solutii.php - About 1 hr to fix

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

                    array(
                            'key' => 'field_5a9a5ec18d139',
                            'label' => 'Partener',
                            'name' => 'partener',
                            'type' => 'relationship',
            Severity: Major
            Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 2 other locations - About 1 hr to fix
            site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 878..903
            site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 904..929

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

            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

                    array(
                            'key' => 'field_5a9a5ec18d137',
                            'label' => 'Etichete',
                            'name' => 'etichete',
                            'type' => 'relationship',
            Severity: Major
            Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 2 other locations - About 1 hr to fix
            site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 904..929
            site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 930..955

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

            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