Showing 137 of 273 total issues
Function reducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, RootAction> = (
state: State,
action: RootAction,
): State | Result<State, RootAction> => {
switch (state.status) {
- Read upRead up
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 find_by
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function find_by( $class, array $params = array() ) {
if ( ! is_subclass_of( $class, 'Intraxia\Jaxion\Axolotl\Model' ) ) {
return new WP_Error( 'invalid_model', __( 'Invalid model', 'wp-gistpen' ) );
}
- Read upRead up
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 apply_settings_route
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function apply_settings_route( $params ) {
$params['route'] = array(
'name' => 'highlighting',
'parts' => $parts = new stdClass(),
);
- Read upRead up
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 reducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const reducer = (
state: State,
action: RootAction,
): State | EddyResult<State, RootAction> => {
switch (state.status) {
- Read upRead up
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 process_entrypoint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function process_entrypoint( Register $assets, $entry, $files, $deps ) {
if ( ! isset( $this->asset_config[ $entry ] ) ) {
throw new Exception( 'Unexpected entry in manifest: ' . $entry );
}
- Read upRead up
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 reducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, RootAction> = (
state: State,
action: RootAction,
) => {
switch (state.status) {
- Read upRead up
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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $data;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $repo->blobs->contains( function ( Blob $blob ) use ( $state ) {
return $state->blob_id === $blob->ID;
} );
Avoid too many return
statements within this method. Open
return array(
'name' => '__GISTPEN_CONTENT__',
'data' => $params->state( 'content' ),
);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $state;
Avoid too many return
statements within this method. Open
return new WP_REST_Response( $blob->serialize(), 200 );
Avoid too many return
statements within this method. Open
return $state->ID;
Avoid too many return
statements within this function. Open
return Kefir.never();
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $state->ID;
Avoid too many return
statements within this method. Open
return $this->find( get_class( $model ), $model->get_primary_id() );
Avoid too many return
statements within this method. Open
return has_shortcode( $post->post_content, 'gistpen' );