brandon14/ebay-sdk-php

View on GitHub
src/Commerce/Notification/V1/Api/TopicApi.php

Summary

Maintainability
D
2 days
Test Coverage

File TopicApi.php has 392 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/Commerce/Notification/V1/Api/TopicApi.php - About 5 hrs to fix

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

        public function getTopicRequest($topic_id)
        {
            // Verify the required parameter 'topic_id' is set.
            if ($topic_id === null || (\is_array($topic_id) && count($topic_id) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $topic_id when calling getTopic');
    Severity: Minor
    Found in src/Commerce/Notification/V1/Api/TopicApi.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 getTopicsRequest has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getTopicsRequest($limit = null, $continuation_token = null)
        {
            $resourcePath = '/topic';
            $formParams = [];
            $queryParams = [];
    Severity: Major
    Found in src/Commerce/Notification/V1/Api/TopicApi.php - About 2 hrs to fix

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

          public function getTopicRequest($topic_id)
          {
              // Verify the required parameter 'topic_id' is set.
              if ($topic_id === null || (\is_array($topic_id) && count($topic_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $topic_id when calling getTopic');
      Severity: Major
      Found in src/Commerce/Notification/V1/Api/TopicApi.php - About 2 hrs to fix

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

            public function getTopicsRequest($limit = null, $continuation_token = null)
            {
                $resourcePath = '/topic';
                $formParams = [];
                $queryParams = [];
        Severity: Minor
        Found in src/Commerce/Notification/V1/Api/TopicApi.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 getTopicsWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getTopicsWithHttpInfo($limit = null, $continuation_token = null)
            {
                $request = $this->getTopicsRequest($limit, $continuation_token);
        
                try {
        Severity: Major
        Found in src/Commerce/Notification/V1/Api/TopicApi.php - About 2 hrs to fix

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

              public function getTopicWithHttpInfo($topic_id)
              {
                  $request = $this->getTopicRequest($topic_id);
          
                  try {
          Severity: Major
          Found in src/Commerce/Notification/V1/Api/TopicApi.php - About 2 hrs to fix

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

                public function getTopicWithHttpInfo($topic_id)
                {
                    $request = $this->getTopicRequest($topic_id);
            
                    try {
            Severity: Minor
            Found in src/Commerce/Notification/V1/Api/TopicApi.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 getTopicsWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getTopicsWithHttpInfo($limit = null, $continuation_token = null)
                {
                    $request = $this->getTopicsRequest($limit, $continuation_token);
            
                    try {
            Severity: Minor
            Found in src/Commerce/Notification/V1/Api/TopicApi.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