overhaul/generator-dharma

View on GitHub

Showing 45 of 49 total issues

File class-tgm-plugin-activation.php has 1058 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Plugin installation and activation for WordPress themes.
 *
 * @package   TGM-Plugin-Activation
Severity: Major
Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 2 days to fix

    Function process_bulk_actions has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
    Open

            public function process_bulk_actions() {
    
                // Bulk installation process.
                if ( 'tgmpa-bulk-install' === $this->current_action() ) {
                    check_admin_referer( 'bulk-' . $this->_args['plural'] );
    Severity: Minor
    Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 2 days 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 notices has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring.
    Open

            public function notices() {
    
                global $current_screen;
    
                // Remove nag on the install page.
    Severity: Minor
    Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 1 day 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 om_the_breadcrumbs has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
    Open

    function om_the_breadcrumbs() {
      $text['home']     = 'Home'; // [1]
      $text['blog']     = 'Blog';
      $text['category'] = '%s Archive'; // [2]
      $text['tax']      = '%s'; // [3]
    Severity: Minor
    Found in app/templates/theme/includes/om-functions.php - About 1 day 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 do_plugin_install has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

            protected function do_plugin_install() {
    
                // All plugin information will be stored in an array for processing.
                $plugin = array();
    
    
    Severity: Minor
    Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 1 day 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 process_bulk_actions has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function process_bulk_actions() {
    
                // Bulk installation process.
                if ( 'tgmpa-bulk-install' === $this->current_action() ) {
                    check_admin_referer( 'bulk-' . $this->_args['plural'] );
    Severity: Major
    Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 6 hrs to fix

      Function _gather_plugin_data has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

              protected function _gather_plugin_data() {
      
                  // Load thickbox for plugin links.
                  TGM_Plugin_Activation::$instance->admin_init();
                  TGM_Plugin_Activation::$instance->thickbox();
      Severity: Minor
      Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 5 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

      Method om_the_breadcrumbs has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function om_the_breadcrumbs() {
        $text['home']     = 'Home'; // [1]
        $text['blog']     = 'Blog';
        $text['category'] = '%s Archive'; // [2]
        $text['tax']      = '%s'; // [3]
      Severity: Major
      Found in app/templates/theme/includes/om-functions.php - About 5 hrs to fix

        Method notices has 128 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function notices() {
        
                    global $current_screen;
        
                    // Remove nag on the install page.
        Severity: Major
        Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 5 hrs to fix

          Function run has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

                      public function run( $options ) {
          
                          // Default config options.
                          $defaults = array(
                              'package'           => '',
          Severity: Minor
          Found in app/templates/theme/includes/class-tgm-plugin-activation.php - 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

          Function init has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                  public function init() {
          
                      do_action( 'tgmpa_register' );
                      // After this point, the plugins should be registered and the configuration set.
          
          
          Severity: Minor
          Found in app/templates/theme/includes/class-tgm-plugin-activation.php - 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

          Method do_plugin_install has 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  protected function do_plugin_install() {
          
                      // All plugin information will be stored in an array for processing.
                      $plugin = array();
          
          
          Severity: Major
          Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 4 hrs to fix

            Method _gather_plugin_data has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    protected function _gather_plugin_data() {
            
                        // Load thickbox for plugin links.
                        TGM_Plugin_Activation::$instance->admin_init();
                        TGM_Plugin_Activation::$instance->thickbox();
            Severity: Major
            Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 2 hrs to fix

              Method run has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          public function run( $options ) {
              
                              // Default config options.
                              $defaults = array(
                                  'package'           => '',
              Severity: Major
              Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 2 hrs to fix

                TGM_Plugin_Activation has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                    class TGM_Plugin_Activation {
                
                        /**
                         * Holds a copy of itself, so it can be referenced by the class name.
                         *
                Severity: Minor
                Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 2 hrs to fix

                  Function config has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public function config( $config ) {
                  
                              $keys = array( 'default_path', 'has_notices', 'dismissable', 'dismiss_msg', 'menu', 'is_automatic', 'message', 'strings' );
                  
                              foreach ( $keys as $key ) {
                  Severity: Minor
                  Found in app/templates/theme/includes/class-tgm-plugin-activation.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 column_plugin has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public function column_plugin( $item ) {
                  
                              $installed_plugins = get_plugins();
                  
                              // No need to display any hover links.
                  Severity: Minor
                  Found in app/templates/theme/includes/class-tgm-plugin-activation.php - About 1 hr to fix

                    Function bulk_install has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                                public function bulk_install( $packages ) {
                    
                                    // Pass installer skin object and set bulk property to true.
                                    $this->init();
                                    $this->bulk = true;
                    Severity: Minor
                    Found in app/templates/theme/includes/class-tgm-plugin-activation.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

                    Function themefiles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      themefiles: function() {
                    
                        this.log(chalk.blue('Creating WordPress theme & function files...'));
                    
                        this.template(
                    Severity: Minor
                    Found in app/index.js - About 1 hr to fix

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

                                  public function after( $title = '' ) {
                      
                                      // Close install strings.
                                      echo '</p></div>';
                      
                      
                      Severity: Minor
                      Found in app/templates/theme/includes/class-tgm-plugin-activation.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

                      Severity
                      Category
                      Status
                      Source
                      Language