intraxia/wp-gistpen

View on GitHub

Showing 137 of 273 total issues

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this method.
    Open

                        return array(
                            'name' => '__GISTPEN_SETTINGS__',
                            'data' => $params->state( 'settings' ),
                        );
    Severity: Major
    Found in app/Register/Assets.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 $blob;
        Severity: Major
        Found in app/Http/BlobController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                  return $this->em->persist( $this->blob_to_state( $blob ) );
          Severity: Major
          Found in app/Listener/Database.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 $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 true;
                Severity: Major
                Found in app/Listener/Database.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 $state->ID;
                    Severity: Major
                    Found in app/Listener/Database.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $prism;
                      Severity: Major
                      Found in app/Http/Filter/SitePatch.php - About 30 mins to fix

                        Function delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function delete( Model $model, $force = false ) {
                                foreach ( $this->repositories as $interface => $repository ) {
                                    if ( is_subclass_of( $model, $interface ) ) {
                                        $model = $repository->delete( $model, $force );
                        
                        
                        Severity: Minor
                        Found in app/Database/EntityManager.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

                        Function apply_blob has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function apply_blob( $params, array $data = array() ) {
                                /**
                                 * Returned blob.
                                 *
                                 * @var BlobModel
                        Severity: Minor
                        Found in app/Params/Blob.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

                        Function Choosing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const Choosing: React.FC<{ collection: Collection; disabled?: boolean }> = ({
                          collection,
                          disabled,
                        }) => {
                          const globals = useGlobals();
                        Severity: Minor
                        Found in client/search/Choosing.tsx - 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

                        Function foldResponse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const foldResponse = <T extends any, S, F>(
                          BodyType: t.Type<T>,
                          success: (t: T) => S,
                          failure: (err: AjaxError) => F,
                        ) => (obs$: Observable<ObsResponse, NetworkError>): Observable<S | F, never> =>
                        Severity: Minor
                        Found in client/api/index.ts - 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

                        Function fetch_prism has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function fetch_prism() {
                                $option = get_option( $this->slug . '_no_priv', [ 'prism' => static::$defaults['prism'] ] );
                        
                                if ( ! is_array( $option ) || ! isset( $option['prism'] ) ) {
                                    $option = [ 'prism' => [] ];
                        Severity: Minor
                        Found in app/Options/Site.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

                        Function sanitize_gist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function sanitize_gist( array $gist ) {
                                foreach ( $gist as $key => $value ) {
                                    if ( ! array_key_exists( $key, Site::$defaults['gist'] ) ) {
                                        return new WP_Error(
                                            'invalid_rest_param',
                        Severity: Minor
                        Found in app/Http/Filter/SitePatch.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