mambax7/smartobject

View on GitHub
admin/update.php

Summary

Maintainability
C
1 day
Test Coverage

Method update_tables_to_300 has 166 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function update_tables_to_300()
{
    $dbupdater = new Wfdownloads\Dbupdater();

    if (!wfdownloads_TableExists('wfdownloads_meta')) {
Severity: Major
Found in admin/update.php - About 6 hrs to fix

    File update.php has 281 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     *
     * Module: SmartSection
    Severity: Minor
    Found in admin/update.php - About 2 hrs to fix

      Method invert_nohtm_dohtml_values has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function invert_nohtm_dohtml_values()
      {
          $ret = [];
          global $xoopsDB;
          $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads');
      Severity: Minor
      Found in admin/update.php - About 1 hr to fix

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

        function update_tables_to_300()
        {
            $dbupdater = new Wfdownloads\Dbupdater();
        
            if (!wfdownloads_TableExists('wfdownloads_meta')) {
        Severity: Minor
        Found in admin/update.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

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

        function get_table_info($table, $default_fields)
        {
            global $xoopsDB;
            $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table);
            while (false !== ($existing_field = $xoopsDB->fetchArray($result))) {
        Severity: Minor
        Found in admin/update.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