civictechro/website-alba-iulia-smart-city

View on GitHub

Showing 73 of 73 total issues

File alba-logo-full-color.blade.php has 10630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"

    File alba-logo-final.blade.php has 6287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
         xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1563 1165"
         style="enable-background:new 0 0 1563 1165;" xml:space="preserve" id="svg2">
    <style type="text/css">
        .st0{opacity:0.76;}

      Method registerCustomFieldGroups has 1038 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private function registerCustomFieldGroups(): void {
          if( function_exists('acf_add_local_field_group') ):
      
          // Homepage
          acf_add_local_field_group(array(
      Severity: Major
      Found in site/web/app/mu-plugins/SmartCityThemeSetup.php - About 5 days to fix

        File alba-logo-full.blade.php has 1828 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <svg id="svg2" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             viewBox="0 0 1650 1012" style="enable-background:new 0 0 1650 1012;" xml:space="preserve">
        <style type="text/css">
            .st0{display:none;}
            .st1{display:inline;opacity:0.1;fill-opacity:0.5;}

          File SmartCityThemeSetup.php has 1324 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Plugin Name: Smart City Theme Setup
           * Description: Configurează WordPress pentru tema Smart City.
           * Plugin URI: https://github.com/civictechro
          Severity: Major
          Found in site/web/app/mu-plugins/SmartCityThemeSetup.php - About 3 days to fix

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

            <?php
            
            namespace App\Algolia;
            
            final class BlogIndexCustomFields extends IndexCustomFields {
            site/web/app/themes/smart-city/app/algolia/NewsIndexCustomFields.php on lines 1..69

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

            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
            
            namespace App\Algolia;
            
            final class NewsIndexCustomFields extends IndexCustomFields {
            site/web/app/themes/smart-city/app/algolia/BlogIndexCustomFields.php on lines 1..69

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

            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
            
              namespace App\Meta;
            
              final class NewsMetaGenerator extends MetaGenerator {
            site/web/app/themes/smart-city/app/meta/BlogMetaGenerator.php on lines 1..64

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

            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
            
              namespace App\Meta;
            
              final class BlogMetaGenerator extends MetaGenerator {
            site/web/app/themes/smart-city/app/meta/NewsMetaGenerator.php on lines 1..64

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

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

              private function registerCustomPostTypes(): void {
            
                register_post_type(
                  AppConstants::POST_TYPE_DOCUMENT,
                  array(
            Severity: Major
            Found in site/web/app/mu-plugins/SmartCityThemeSetup.php - About 7 hrs to fix

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

              <?php
              
              namespace App;
              
              use Sober\Controller\Controller;
              Severity: Major
              Found in site/web/app/themes/smart-city/app/controllers/Post.php and 1 other location - About 6 hrs to fix
              site/web/app/themes/smart-city/app/controllers/News.php on lines 1..39

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

              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
              
              namespace App;
              
              use Sober\Controller\Controller;
              Severity: Major
              Found in site/web/app/themes/smart-city/app/controllers/News.php and 1 other location - About 6 hrs to fix
              site/web/app/themes/smart-city/app/controllers/Post.php on lines 1..39

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

              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

                  acf_add_local_field_group(array(
                    'key' => 'group_5a80af3fad689',
                    'title' => 'Etapă proiect',
                    'fields' => array(
                      array(
              Severity: Major
              Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 5 hrs to fix
              site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 1173..1219

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

              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

                  acf_add_local_field_group(array(
                    'key' => 'group_5a80af3fad6b7',
                    'title' => 'Etichetă proiect',
                    'fields' => array(
                      array(
              Severity: Major
              Found in site/web/app/mu-plugins/SmartCityThemeSetup.php and 1 other location - About 5 hrs to fix
              site/web/app/mu-plugins/SmartCityThemeSetup.php on lines 1329..1375

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

              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

              Proiect has 34 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Proiect extends Controller {
                public static function verticala(): string {
                  return get_field('verticala')[0]->post_title;
                }
              
              
              Severity: Minor
              Found in site/web/app/themes/smart-city/app/controllers/Proiect.php - About 4 hrs to fix

                Function finalize has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  finalize() {
                    let is_logo_animating = false;
                    // JavaScript to be fired on the home page
                    $(document).scroll(function() {
                      if($(this).scrollTop() >= $('#svg2').position().top - $('#svg2').height()){

                  Function display has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def display(obj, result):
                      msg = ''
                      result = result._result
                      display = obj._display.display
                      wrap_width = 77
                  Severity: Minor
                  Found in trellis/lib/trellis/utils/output.py - About 4 hrs 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

                  File taburi-proiect.blade.php has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <div class="scrolling-wrapper">
                    <div class="mobile-tabs-hint d-md-none slideInRight">
                      <i class="far fa-hand-point-up" style="color: {{ Proiect::culoareVerticala() }}"></i>
                    </div>
                    <ul

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

                    <script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.7.1"></script>
                    
                    <div class="container-fluid solutii-listing">
                      <div class="container">
                    
                    

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

                          register_post_type(
                            AppConstants::POST_TYPE_LINKS,
                            array(
                              'labels' => array(
                                'name' => __('Link-uri utile'),
                      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 279..297

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language