Alecaddd/awps

View on GitHub

Showing 19 of 27 total issues

Function edit has 167 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    edit( { attributes, className, setAttributes } ) {
        const {
            title,
            body,
            backgroundImage,
Severity: Major
Found in assets/src/scripts/blocks/cta.js - About 6 hrs to fix

    Method custom_post_type has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function custom_post_type()
        {
            /**
             * Add the post types and their details
             */
    Severity: Major
    Found in inc/Custom/PostTypes.php - About 3 hrs to fix

      File cta.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const { registerBlockType } = wp.blocks;
      const {
          PlainText,
          RichText,
          MediaUpload,
      Severity: Minor
      Found in assets/src/scripts/blocks/cta.js - About 2 hrs to fix

        Method register has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function register( $wp_customize ) 
            {
                $wp_customize->add_section( 'awps_header_section' , array(
                    'title' => __( 'Header', 'awps' ),
                    'description' => __( 'Customize the Header' ),
        Severity: Major
        Found in inc/Api/Customizer/Header.php - About 2 hrs to fix

          Function mix has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              function mix($path, $manifestDirectory = '')
              {
                  if (! $manifestDirectory) {
                      //Setup path for standard AWPS-Folder-Structure
                      $manifestDirectory = "assets/dist/";
          Severity: Minor
          Found in inc/Helpers.php - About 2 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

          Function save has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              save( { attributes } ) {
                  const {
                      title,
                      body,
                      titleColor,
          Severity: Minor
          Found in assets/src/scripts/blocks/cta.js - About 1 hr to fix

            Method start_el has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
                {
                    $indent = ($depth) ? str_repeat("\t", $depth) : '';
            
                    $li_attributes = '';
            Severity: Minor
            Found in inc/Core/WalkerNav.php - About 1 hr to fix

              Function display_element has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
                  {
                      if (!$element) {
                          return;
                      }
              Severity: Minor
              Found in inc/Core/WalkerNav.php - 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 register has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function register( $wp_customize ) 
                  {
                      $wp_customize->add_section( 'awps_footer_section' , array(
                          'title' => __( 'Footer', 'awps' ),
                          'description' => __( 'Customize the Footer' ),
              Severity: Minor
              Found in inc/Api/Customizer/Footer.php - About 1 hr to fix

                Function admin_scripts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function admin_scripts( $hook )
                    {
                        // dd( $hook );
                        $this->enqueue_on_pages = ( !empty( $this->enqueue_on_pages ) ) ? $this->enqueue_on_pages : array( $hook );
                
                
                Severity: Minor
                Found in inc/Api/Settings.php - 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 gutenberg_init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function gutenberg_init()
                    {
                        add_theme_support( 'gutenberg', array(
                            // Theme supports responsive video embeds
                            'responsive-embeds' => true,
                Severity: Minor
                Found in inc/Api/Gutenberg.php - About 1 hr to fix

                  Method display_element has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
                      {
                          if (!$element) {
                              return;
                          }
                  Severity: Minor
                  Found in inc/Core/WalkerNav.php - About 1 hr to fix

                    Method setup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function setup()
                        {
                            /*
                             * You can activate this if you're planning to build a multilingual theme
                             */
                    Severity: Minor
                    Found in inc/Setup/Setup.php - About 1 hr to fix

                      Method mix has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function mix($path, $manifestDirectory = '')
                          {
                              if (! $manifestDirectory) {
                                  //Setup path for standard AWPS-Folder-Structure
                                  $manifestDirectory = "assets/dist/";
                      Severity: Minor
                      Found in inc/Helpers.php - About 1 hr to fix

                        Function entry_footer has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function entry_footer()
                            {
                        
                                // Hide category and tag text for pages.
                                if ('post' === get_post_type()) {
                        Severity: Minor
                        Found in inc/Core/Tags.php - About 55 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method display_element has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
                        Severity: Minor
                        Found in inc/Core/WalkerNav.php - About 45 mins to fix

                          Function start_el has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
                              {
                                  $indent = ($depth) ? str_repeat("\t", $depth) : '';
                          
                                  $li_attributes = '';
                          Severity: Minor
                          Found in inc/Core/WalkerNav.php - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method start_el has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
                          Severity: Minor
                          Found in inc/Core/WalkerNav.php - About 35 mins to fix

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

                                function starts_with($haystack, $needles)
                                {
                                    foreach ((array) $needles as $needle) {
                                        if ($needle != '' && substr($haystack, 0, strlen($needle)) === (string) $needle) {
                                            return true;
                            Severity: Minor
                            Found in inc/Helpers.php - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language