woothemes/woocommerce

View on GitHub
includes/rest-api/Controllers/Version2/class-wc-rest-order-notes-v2-controller.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method get_item_schema has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get_item_schema() {
        $schema = array(
            '$schema'    => 'http://json-schema.org/draft-04/schema#',
            'title'      => 'order_note',
            'type'       => 'object',

    Method get_items has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_items( $request ) {
            $order = wc_get_order( (int) $request['order_id'] );
    
            if ( ! $order || $this->post_type !== $order->get_type() ) {
                return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid order ID.', 'woocommerce' ), array( 'status' => 404 ) );

      There are no issues that match your filters.

      Category
      Status