awsmug/torro-forms

View on GitHub
src/db-objects/submissions/submissions-list-table.php

Summary

Maintainability
C
1 day
Test Coverage

Function build_views has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function build_views( &$current, $list_url = '' ) {
        $capabilities = $this->manager->capabilities();

        $form_id = filter_input( INPUT_GET, 'form_id', FILTER_VALIDATE_INT );
        if ( empty( $form_id ) ) {
Severity: Minor
Found in src/db-objects/submissions/submissions-list-table.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 build_views has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function build_views( &$current, $list_url = '' ) {
        $capabilities = $this->manager->capabilities();

        $form_id = filter_input( INPUT_GET, 'form_id', FILTER_VALIDATE_INT );
        if ( empty( $form_id ) ) {
Severity: Major
Found in src/db-objects/submissions/submissions-list-table.php - About 2 hrs to fix

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

        protected function timestamp_months_dropdown( $timestamp_property ) {
            global $wp_locale;
    
            $where      = '';
            $where_args = array();
    Severity: Minor
    Found in src/db-objects/submissions/submissions-list-table.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 timestamp_months_dropdown has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function timestamp_months_dropdown( $timestamp_property ) {
            global $wp_locale;
    
            $where      = '';
            $where_args = array();
    Severity: Minor
    Found in src/db-objects/submissions/submissions-list-table.php - About 1 hr to fix

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

          protected function build_query_params( $number, $offset ) {
              $query_params = parent::build_query_params( $number, $offset );
      
              $capabilities = $this->manager->capabilities();
      
      
      Severity: Minor
      Found in src/db-objects/submissions/submissions-list-table.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 build_query_params has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function build_query_params( $number, $offset ) {
              $query_params = parent::build_query_params( $number, $offset );
      
              $capabilities = $this->manager->capabilities();
      
      
      Severity: Minor
      Found in src/db-objects/submissions/submissions-list-table.php - About 1 hr to fix

        Method build_row_actions has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function build_row_actions( $submission, $submission_id, $view_url = '', $edit_url = '', $list_url = '' ) {
        Severity: Minor
        Found in src/db-objects/submissions/submissions-list-table.php - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status