AppStateESS/homestead

View on GitHub
class/SOAP.php

Summary

Maintainability
B
6 hrs
Test Coverage

SOAP has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class SOAP
{

    // User types
    const ADMIN_USER    = 'A';
Severity: Minor
Found in class/SOAP.php - About 2 hrs to fix

Function getInstance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstance($username, $userType)
    {
        if(!isset($username) || is_null($username)){
            throw new \InvalidArgumentException('Missing Username.');
        }
Severity: Minor
Found in class/SOAP.php - About 45 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

Method removeRoomAssignment has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public abstract function removeRoomAssignment($bannerId, $term, $building, $bannerBedId, $percentRefund);
Severity: Minor
Found in class/SOAP.php - About 35 mins to fix

Method addRoomDamageToStudentAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public abstract function addRoomDamageToStudentAccount($bannerId, $term, $amount, $damageDescription, $detailCode);
Severity: Minor
Found in class/SOAP.php - About 35 mins to fix

Method logSoap has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

     protected static function logSoap($function, $result, Array $params, $responseCode = null, $errorMessage = null)
Severity: Minor
Found in class/SOAP.php - About 35 mins to fix

Method reportRoomAssignment has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function reportRoomAssignment($username, $term, $building_code, $room_code, $plan_code)
Severity: Minor
Found in class/SOAP.php - About 35 mins to fix

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

     protected static function logSoap($function, $result, Array $params, $responseCode = null, $errorMessage = null)
     {
         $args = '';

         foreach($params as $p){
Severity: Minor
Found in class/SOAP.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

There are no issues that match your filters.

Category
Status