deep-web-solutions/wordpress-framework-foundations

View on GitHub

Showing 13 of 29 total issues

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

    protected function add_container_children(): ?InitializationFailureException {
        $init_result = null;

        if ( $this instanceof ParentInterface ) {
            $di_container = null;
Severity: Minor
Found in src/includes/Hierarchy/Actions/AddContainerChildrenTrait.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 maybe_execute_extension_traits has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function maybe_execute_extension_traits( string $extension_trait, $success_return = null, string $prefix = '' ) {
        if ( Objects::has_trait_deep( $extension_trait, $this ) ) {
            foreach ( Objects::class_uses_deep_list( $this ) as $trait ) {
                if ( ! isset( Objects::trait_uses_deep_list( $trait )[ $extension_trait ] ) ) {
                    continue;
Severity: Minor
Found in src/includes/Helpers/ActionExtensionHelpersTrait.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 integrate_maybe_setup_children has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function integrate_maybe_setup_children(): ?SetupFailureException {
        $setup_result = null;

        if ( $this instanceof ParentInterface ) {
            $children = $this->get_children();
Severity: Minor
Found in src/includes/Hierarchy/Actions/MaybeSetupChildrenTrait.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 integrate_setup_children has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function integrate_setup_children(): ?SetupFailureException {
        $setup_result = null;

        if ( $this instanceof ParentInterface ) {
            $children = $this->get_children();
Severity: Minor
Found in src/includes/Hierarchy/Actions/SetupChildrenTrait.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 integrate_initialize_children has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function integrate_initialize_children(): ?InitializationFailureException {
        $init_result = null;

        if ( $this instanceof ParentInterface ) {
            $children = $this->get_children();
Severity: Minor
Found in src/includes/Hierarchy/Actions/InitializeChildrenTrait.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 reset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function reset(): ?ResetFailureException {
        if ( \is_null( $this->is_reset ) ) {
            if ( ! \is_null( $result = $this->maybe_execute_local_trait( ResetLocalTrait::class, 'reset' ) ) ) { // phpcs:ignore
                $this->is_reset     = false;
                $this->reset_result = $result;
Severity: Minor
Found in src/includes/Actions/Resettable/ResettableTrait.php - About 55 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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function run(): ?RunFailureException {
        if ( \is_null( $this->is_run ) ) {
            if ( ! \is_null( $result = $this->maybe_execute_local_trait( RunLocalTrait::class, 'run' ) ) ) { // phpcs:ignore
                $this->is_run     = false;
                $this->run_result = $result;
Severity: Minor
Found in src/includes/Actions/Runnable/RunnableTrait.php - About 55 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 reset_handlers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function reset_handlers(): ?ResetFailureException {
        $reset_result = null;

        if ( $this instanceof HandlerAwareInterface || $this instanceof MultiHandlerAwareInterface ) {
            $handlers = ( $this instanceof HandlerAwareInterface ) ? array( $this->get_handler() ) : $this->get_handlers();
Severity: Minor
Found in src/includes/Services/Actions/ResetHandlersTrait.php - About 45 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 run_handlers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function run_handlers(): ?RunFailureException {
        $run_result = null;

        if ( $this instanceof HandlerAwareInterface || $this instanceof MultiHandlerAwareInterface ) {
            $handlers = ( $this instanceof HandlerAwareInterface ) ? array( $this->get_handler() ) : $this->get_handlers();
Severity: Minor
Found in src/includes/Services/Actions/RunHandlersTrait.php - About 45 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 output_handlers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function output_handlers(): ?OutputFailureException {
        $output_result = null;

        if ( $this instanceof HandlerAwareInterface || $this instanceof MultiHandlerAwareInterface ) {
            $handlers = ( $this instanceof HandlerAwareInterface ) ? array( $this->get_handler() ) : $this->get_handlers();
Severity: Minor
Found in src/includes/Services/Actions/OutputHandlersTrait.php - About 45 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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function initialize(): ?InitializationFailureException {
        if ( \is_null( $this->is_initialized ) ) {
            if ( ! \is_null( $result = $this->maybe_execute_local_trait( InitializeLocalTrait::class, 'initialize' ) ) ) { // phpcs:ignore
                $this->is_initialized        = false;
                $this->initialization_result = $result;
Severity: Minor
Found in src/includes/Actions/Initializable/InitializableTrait.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 setup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setup(): ?SetupFailureException {
        if ( \is_null( $this->is_setup ) ) {
            if ( ! \is_null( $result = $this->maybe_execute_local_trait( SetupLocalTrait::class, 'setup' ) ) ) { // phpcs:ignore
                $this->is_setup     = false;
                $this->setup_result = $result;
Severity: Minor
Found in src/includes/Actions/Setupable/SetupableTrait.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 output has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function output(): ?OutputFailureException {
        if ( \is_null( $this->is_outputted ) ) {
            if ( ! \is_null( $result = $this->maybe_execute_local_trait( OutputLocalTrait::class, 'output' ) ) ) { // phpcs:ignore
                $this->is_outputted  = false;
                $this->output_result = $result;
Severity: Minor
Found in src/includes/Actions/Outputtable/OutputtableTrait.php - About 25 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

Severity
Category
Status
Source
Language