CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/includes/schema.php

Summary

Maintainability
D
2 days
Test Coverage

File schema.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * WordPress Administration Scheme API
 *
 * Here we keep the DB structure and option values.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 6 hrs to fix

    Method populate_options has 130 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function populate_options() {
        global $wpdb, $wp_db_version;
    
        $guessurl = wp_guess_url();
    
    
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 5 hrs to fix

      Method populate_roles_160 has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function populate_roles_160() {
          // Add roles
      
          // Dummy gettext calls to get strings in the catalog.
          /* translators: user role */
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 3 hrs to fix

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

        function populate_options() {
            global $wpdb, $wp_db_version;
        
            $guessurl = wp_guess_url();
        
        
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.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

        Method populate_roles_210 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function populate_roles_210() {
            $roles = array('administrator', 'editor');
            foreach ($roles as $role) {
                $role =& get_role($role);
                if ( empty($role) )
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 1 hr to fix

          Function populate_roles_210 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function populate_roles_210() {
              $roles = array('administrator', 'editor');
              foreach ($roles as $role) {
                  $role =& get_role($role);
                  if ( empty($role) )
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 35 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

          There are no issues that match your filters.

          Category
          Status