brandon14/ebay-sdk-php

View on GitHub
src/Sell/Marketing/V1/Api/AdReportMetadataApi.php

Summary

Maintainability
D
2 days
Test Coverage

File AdReportMetadataApi.php has 378 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * This file is part of the trollandtoad/ebay-sdk-php package.
 *
Severity: Minor
Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 5 hrs to fix

    Function getReportMetadataForReportTypeRequest has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getReportMetadataForReportTypeRequest($report_type)
        {
            // Verify the required parameter 'report_type' is set.
            if ($report_type === null || (\is_array($report_type) && count($report_type) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $report_type when calling getReportMetadataForReportType');
    Severity: Minor
    Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs 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

    Method getReportMetadataForReportTypeRequest has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getReportMetadataForReportTypeRequest($report_type)
        {
            // Verify the required parameter 'report_type' is set.
            if ($report_type === null || (\is_array($report_type) && count($report_type) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $report_type when calling getReportMetadataForReportType');
    Severity: Major
    Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs to fix

      Method getReportMetadataRequest has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getReportMetadataRequest()
          {
              $resourcePath = '/ad_report_metadata';
              $formParams = [];
              $queryParams = [];
      Severity: Major
      Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs to fix

        Function getReportMetadataRequest has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getReportMetadataRequest()
            {
                $resourcePath = '/ad_report_metadata';
                $formParams = [];
                $queryParams = [];
        Severity: Minor
        Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs 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

        Method getReportMetadataWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getReportMetadataWithHttpInfo()
            {
                $request = $this->getReportMetadataRequest();
        
                try {
        Severity: Major
        Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs to fix

          Method getReportMetadataForReportTypeWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getReportMetadataForReportTypeWithHttpInfo($report_type)
              {
                  $request = $this->getReportMetadataForReportTypeRequest($report_type);
          
                  try {
          Severity: Major
          Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.php - About 2 hrs to fix

            Function getReportMetadataWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getReportMetadataWithHttpInfo()
                {
                    $request = $this->getReportMetadataRequest();
            
                    try {
            Severity: Minor
            Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.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 getReportMetadataForReportTypeWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getReportMetadataForReportTypeWithHttpInfo($report_type)
                {
                    $request = $this->getReportMetadataForReportTypeRequest($report_type);
            
                    try {
            Severity: Minor
            Found in src/Sell/Marketing/V1/Api/AdReportMetadataApi.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

            There are no issues that match your filters.

            Category
            Status