intraxia/wp-gistpen

View on GitHub

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) {
Severity: Minor
Found in client/block/SetEmbed/Creating/state.tsx - 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 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' ) );
        }

Severity: Minor
Found in app/Database/EntityManager.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 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(),
        );
Severity: Minor
Found in app/Params/Route.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 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) {
Severity: Minor
Found in client/block/SetEmbed/index.tsx - 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 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 );
        }

Severity: Minor
Found in app/Register/Assets.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 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) {
Severity: Minor
Found in client/block/state.ts - 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

Avoid too many return statements within this method.
Open

                return false;
Severity: Major
Found in app/Jobs/ExportJob.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return $data;
    Severity: Major
    Found in app/Database/Repository/WordPressCustomTable.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return false;
      Severity: Major
      Found in app/Jobs/ExportJob.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $repo->blobs->contains( function ( Blob $blob ) use ( $state ) {
                        return $state->blob_id === $blob->ID;
                    } );
        Severity: Major
        Found in app/Listener/Database.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return array(
                                  'name' => '__GISTPEN_CONTENT__',
                                  'data' => $params->state( 'content' ),
                              );
          Severity: Major
          Found in app/Register/Assets.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in app/Listener/Database.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return $state;
              Severity: Major
              Found in app/Listener/Database.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return new WP_REST_Response( $blob->serialize(), 200 );
                Severity: Major
                Found in app/Http/BlobController.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $state->ID;
                  Severity: Major
                  Found in app/Listener/Database.php - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return Kefir.never();
                    Severity: Major
                    Found in client/deltas/jobsDelta.ts - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return false;
                      Severity: Major
                      Found in app/Jobs/ExportJob.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $state->ID;
                        Severity: Major
                        Found in app/Database/Repository/WordPressPost.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $this->find( get_class( $model ), $model->get_primary_id() );
                          Severity: Major
                          Found in app/Database/Repository/WordPressPost.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                return has_shortcode( $post->post_content, 'gistpen' );
                            Severity: Major
                            Found in app/Register/Assets.php - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language