mariuz/firebirdwebadmin

View on GitHub
inc/triggers.inc.php

Summary

Maintainability
C
7 hrs
Test Coverage

File triggers.inc.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// File           triggers.inc.php / FirebirdWebAdmin
// Purpose        functions working with triggerss, included from accessories.php
// Author         Lutz Brueckner <irie@gmx.de>
// Copyright      (c) 2000, 2001, 2002, 2003, 2004, 2005 by Lutz Brueckner,
Severity: Minor
Found in inc/triggers.inc.php - About 2 hrs to fix

    Method get_trigger_definition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function get_trigger_definition($title)
    {
        global $s_triggerdefs, $acc_strings, $s_cust;
    
        $trigger_source = htmlspecialchars($s_triggerdefs['source']);
    Severity: Minor
    Found in inc/triggers.inc.php - About 1 hr to fix

      Method get_opened_trigger has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function get_opened_trigger($name, $trigger, $url)
      {
          global $dbhandle, $acc_strings, $ptitle_strings;
      
          $type_str = implode('<br>', $trigger['type']);
      Severity: Minor
      Found in inc/triggers.inc.php - About 1 hr to fix

        Method get_triggers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function get_triggers($oldtriggers)
        {
            global $dbhandle;
        
            $lsql = 'SELECT RDB$TRIGGER_NAME AS NAME,'
        Severity: Minor
        Found in inc/triggers.inc.php - About 1 hr to fix

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

          function get_triggertype_selectlist($name, $sel = null, $empty = false)
          {
              $types = array('insert', 'update', 'delete');
              $html = '';
              if (SERVER_FAMILY == 'FB'  &&  SERVER_VERSION >= 15) {
          Severity: Minor
          Found in inc/triggers.inc.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

          There are no issues that match your filters.

          Category
          Status