vint3creative/shortcodes-for-woocommerce

View on GitHub

Showing 12 of 12 total issues

Method featured_products_by_category has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function featured_products_by_category( $atts ) {

        if ( ! $this->is_woocommerce_active() ) {
            return;
        }
Severity: Major
Found in lib/Shortcode.php - About 2 hrs to fix

    Method subcategories_from_category has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function subcategories_from_category( $atts ) {
    
            if ( ! $this->is_woocommerce_active() ) {
                return;
            }
    Severity: Major
    Found in lib/Shortcode.php - About 2 hrs to fix

      Class file names should be based on the class name with "class-" prepended. Expected class-plugin.php, but found Plugin.php.
      Open

      <?php
      Severity: Minor
      Found in lib/Plugin.php by phpcodesniffer

      Filenames should be all lowercase with hyphens as word separators. Expected shortcode.php, but found Shortcode.php.
      Open

      <?php
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Filenames should be all lowercase with hyphens as word separators. Expected plugin.php, but found Plugin.php.
      Open

      <?php
      Severity: Minor
      Found in lib/Plugin.php by phpcodesniffer

      Array double arrow not aligned correctly; expected 10 space(s) between "'meta_query'" and double arrow, but found 1.
      Open

                  'meta_query' => array(
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Parenthesis should always be used when instantiating a new object.
      Open

                  'walker'       => \apply_filters( 'woocommerce_shortcode_subcategories_from_category_walker', new \Walker_Category, $atts ),
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Array double arrow not aligned correctly; expected 3 space(s) between "'key'" and double arrow, but found 5.
      Open

                          'key'     => '_featured',
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Class file names should be based on the class name with "class-" prepended. Expected class-shortcode.php, but found Shortcode.php.
      Open

      <?php
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Array double arrow not aligned correctly; expected 1 space(s) between "'value'" and double arrow, but found 3.
      Open

                          'value'   => 'yes',
      Severity: Minor
      Found in lib/Shortcode.php by phpcodesniffer

      Missing class import via use statement (line '181', column '102').
      Open

                  'walker'       => \apply_filters( 'woocommerce_shortcode_subcategories_from_category_walker', new \Walker_Category, $atts ),
      Severity: Minor
      Found in lib/Shortcode.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '220', column '19').
      Open

              $products = new \WP_Query( $query_args );
      Severity: Minor
      Found in lib/Shortcode.php by phpmd

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Severity
      Category
      Status
      Source
      Language