classes/class-connector.php

Summary

Maintainability
B
6 hrs
Test Coverage
A
95%

Function get_changed_keys has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_changed_keys( $old_value, $new_value, $deep = false ) {
        if ( ! is_array( $old_value ) && ! is_array( $new_value ) ) {
            return array();
        }

Severity: Minor
Found in classes/class-connector.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 get_changed_keys has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_changed_keys( $old_value, $new_value, $deep = false ) {
        if ( ! is_array( $old_value ) && ! is_array( $new_value ) ) {
            return array();
        }

Severity: Major
Found in classes/class-connector.php - About 2 hrs to fix

    Method log has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function log( $message, $args, $object_id, $context, $action, $user_id = null ) {
    Severity: Minor
    Found in classes/class-connector.php - About 45 mins to fix

      Avoid too many return statements within this method.
      Open

                      return (string) (int) $value !== (string) $value;
      Severity: Major
      Found in classes/class-connector.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $result;
        Severity: Major
        Found in classes/class-connector.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $result; // Return an numerical based array with changed TOP PARENT keys only.
          Severity: Major
          Found in classes/class-connector.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status