XoopsModules25x/mylinks

View on GitHub
admin/mytplsadmin.php

Summary

Maintainability
B
4 hrs
Test Coverage

File mytplsadmin.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// ------------------------------------------------------------------------- //
//                              mytplsadmin.php                              //
//               - XOOPS templates admin for each modules -                  //
//                          GIJOE <http://www.peak.ne.jp/>                   //
Severity: Minor
Found in admin/mytplsadmin.php - About 2 hrs to fix

    Function copy_templates_db2db has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function copy_templates_db2db($tplset_from, $tplset_to, $whr_append = '1')
    {
        global $db;
    
        // get tplfile and tplsource
    Severity: Minor
    Found in admin/mytplsadmin.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 copy_templates_f2db has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    function copy_templates_f2db($tplset_to, $whr_append = '1')
    {
        global $db;
    
        // get tplsource
    Severity: Minor
    Found in admin/mytplsadmin.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