brandon14/ebay-sdk-php

View on GitHub
src/Sell/Account/V1/Api/ProgramApi.php

Summary

Maintainability
F
4 days
Test Coverage

File ProgramApi.php has 542 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * This file is part of the trollandtoad/ebay-sdk-php package.
 *
Severity: Major
Found in src/Sell/Account/V1/Api/ProgramApi.php - About 1 day to fix

    Function optOutOfProgramRequest has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function optOutOfProgramRequest($program)
        {
            // Verify the required parameter 'program' is set.
            if ($program === null || (\is_array($program) && count($program) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $program when calling optOutOfProgram');
    Severity: Minor
    Found in src/Sell/Account/V1/Api/ProgramApi.php - About 3 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

    Function optInToProgramRequest has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function optInToProgramRequest($program)
        {
            // Verify the required parameter 'program' is set.
            if ($program === null || (\is_array($program) && count($program) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $program when calling optInToProgram');
    Severity: Minor
    Found in src/Sell/Account/V1/Api/ProgramApi.php - About 3 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 optOutOfProgramRequest has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method optInToProgramRequest has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

            public function getOptedInProgramsRequest()
            {
                $resourcePath = '/program/get_opted_in_programs';
                $formParams = [];
                $queryParams = [];
        Severity: Major
        Found in src/Sell/Account/V1/Api/ProgramApi.php - About 2 hrs to fix

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

              public function getOptedInProgramsRequest()
              {
                  $resourcePath = '/program/get_opted_in_programs';
                  $formParams = [];
                  $queryParams = [];
          Severity: Minor
          Found in src/Sell/Account/V1/Api/ProgramApi.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 optOutOfProgramWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function optOutOfProgramWithHttpInfo($program)
              {
                  $request = $this->optOutOfProgramRequest($program);
          
                  try {
          Severity: Major
          Found in src/Sell/Account/V1/Api/ProgramApi.php - About 2 hrs to fix

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

                public function getOptedInProgramsWithHttpInfo()
                {
                    $request = $this->getOptedInProgramsRequest();
            
                    try {
            Severity: Major
            Found in src/Sell/Account/V1/Api/ProgramApi.php - About 2 hrs to fix

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

                  public function optInToProgramWithHttpInfo($program)
                  {
                      $request = $this->optInToProgramRequest($program);
              
                      try {
              Severity: Major
              Found in src/Sell/Account/V1/Api/ProgramApi.php - About 2 hrs to fix

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

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

                    public function optInToProgramWithHttpInfo($program)
                    {
                        $request = $this->optInToProgramRequest($program);
                
                        try {
                Severity: Minor
                Found in src/Sell/Account/V1/Api/ProgramApi.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 optOutOfProgramWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function optOutOfProgramWithHttpInfo($program)
                    {
                        $request = $this->optOutOfProgramRequest($program);
                
                        try {
                Severity: Minor
                Found in src/Sell/Account/V1/Api/ProgramApi.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