civictechro/website-alba-iulia-smart-city

View on GitHub

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

            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

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

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

                        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

                              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

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

                                  finalize() {
                                    // JavaScript to be fired on all pages, after page specific JS is fired
                                    let visitedColors = [];
                                    $('.project-box .body').each((idx, elem) => {
                                      let parent = $(elem).parent();

                                  Method sections has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    public static function sections(): array {
                                      $sections = get_posts(array(
                                        'post_type' => \AppConstants::POST_TYPE_DESPRE,
                                        'posts_per_page' => 20,
                                      ));
                                  Severity: Minor
                                  Found in site/web/app/themes/smart-city/app/controllers/Despre.php - About 1 hr to fix

                                    Method proiecte has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      public static function proiecte(): array {
                                        $projects = get_posts(array(
                                          'post_type' => \AppConstants::POST_TYPE_PROJECT,
                                          'posts_per_page' => 4,
                                          'orderby' => 'rand',
                                    Severity: Minor
                                    Found in site/web/app/themes/smart-city/app/controllers/front-page.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language