atmonshi/sender

View on GitHub

Showing 54 of 54 total issues

Method convertToUnicode has 308 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function convertToUnicode($message)
{
    $chrArray[0] = "،";
    $unicodeArray[0] = "060C";
    $chrArray[1] = "؛";
Severity: Major
Found in src/mobilyWs/functionUnicode.php - About 1 day to fix

    File CURL.php has 487 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace atmonshi\sender\STag;
    
    class CURL
    Severity: Minor
    Found in src/STag/CURL.php - About 7 hrs to fix

      CURL has 38 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class CURL
      {
          const VERSION = '2.1.0';
      
          private $cookies = [];
      Severity: Minor
      Found in src/STag/CURL.php - About 5 hrs to fix

        Function get has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function get($url_mixed, $data = [])
            {
                if (is_array($url_mixed)) {
                    $curl_multi = curl_multi_init();
                    $this->multi_parent = true;
        Severity: Minor
        Found in src/STag/CURL.php - About 4 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

        File fsockopen.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        //دالة فحص  حالة الإرسال بإستخدام بوابة fsockopen
        function sendStatus($viewResult=1)
        {
            global $arraySendStatus;
        Severity: Minor
        Found in src/mobilyWs/fsockopen.php - About 3 hrs to fix

          File functionUnicode.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          //دالة تحويل الرساله إلى ترميز UNICODE الخاص بالإرسال من خلال بوابة موبايلي
          function convertToUnicode($message)
          {
              $chrArray[0] = "،";
          Severity: Minor
          Found in src/mobilyWs/functionUnicode.php - About 3 hrs to fix

            Function parseResponse has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                private function parseResponse($response)
                {
                    $response_headers = '';
                    $raw_response = $response;
                    if (!(strpos($response, "\r\n\r\n") === false)) {
            Severity: Minor
            Found in src/STag/CURL.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 postfields has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                private function postfields($data)
                {
                    if (is_array($data)) {
                        if (self::is_array_multidim($data)) {
                            $data = self::http_build_multi_query($data);
            Severity: Minor
            Found in src/STag/CURL.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 mobilesMangment has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                private function mobilesMangment($serviceVars = [])
                {
                    if (!isset($serviceVars['action'])) {
                        throw new \Exception(' Not a valid action , or must be create,update,delete,get ');
                    }
            Severity: Minor
            Found in src/STag/STagAPI.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

            Function groupsMangment has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                private function groupsMangment($serviceVars = [])
                {
                    if (!isset($serviceVars['action'])) {
                        throw new \Exception(' Not a valid action , or must be creat,delete,get,getMobiles ');
                    }
            Severity: Minor
            Found in src/STag/STagAPI.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 get has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get($url_mixed, $data = [])
                {
                    if (is_array($url_mixed)) {
                        $curl_multi = curl_multi_init();
                        $this->multi_parent = true;
            Severity: Minor
            Found in src/STag/CURL.php - About 1 hr to fix

              Function printStringResult has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              function printStringResult($apiResult, $arrayMsgs, $printType = 'Alpha')
              {
                  global $undefinedResult;
                  switch ($printType)
                  {
              Severity: Minor
              Found in src/mobilyWs/functionPrintResult.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

              Method printStringResult has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function printStringResult($apiResult, $arrayMsgs, $printType = 'Alpha')
              {
                  global $undefinedResult;
                  switch ($printType)
                  {
              Severity: Minor
              Found in src/mobilyWs/functionPrintResult.php - About 1 hr to fix

                Method mobilesMangment has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function mobilesMangment($serviceVars = [])
                    {
                        if (!isset($serviceVars['action'])) {
                            throw new \Exception(' Not a valid action , or must be create,update,delete,get ');
                        }
                Severity: Minor
                Found in src/STag/STagAPI.php - About 1 hr to fix

                  Method groupsMangment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function groupsMangment($serviceVars = [])
                      {
                          if (!isset($serviceVars['action'])) {
                              throw new \Exception(' Not a valid action , or must be creat,delete,get,getMobiles ');
                          }
                  Severity: Minor
                  Found in src/STag/STagAPI.php - About 1 hr to fix

                    Method sendSMSWK has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function sendSMSWK($userAccount, $passAccount, $numbers, $sender, $msg, $msgKey, $MsgID, $timeSend=0, $dateSend=0, $deleteKey=0, $viewResult=1)
                    Severity: Major
                    Found in src/mobilyWs/fopen.php - About 1 hr to fix

                      Method sendSMSWK has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function sendSMSWK($userAccount, $passAccount, $numbers, $sender, $msg, $msgKey, $MsgID, $timeSend=0, $dateSend=0, $deleteKey=0, $viewResult=1)
                      Severity: Major
                      Found in src/mobilyWs/filegetcontents.php - About 1 hr to fix

                        Method sendSMSWK has 11 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function sendSMSWK($userAccount, $passAccount, $numbers, $sender, $msg, $msgKey, $MsgID, $timeSend=0, $dateSend=0, $deleteKey=0, $viewResult=1)
                        Severity: Major
                        Found in src/mobilyWs/file.php - About 1 hr to fix

                          Method sendSMSWK has 11 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function sendSMSWK($userAccount, $passAccount, $numbers, $sender, $msg, $msgKey, $MsgID, $timeSend=0, $dateSend=0, $deleteKey=0, $viewResult=1)
                          Severity: Major
                          Found in src/mobilyWs/fsockopen.php - About 1 hr to fix

                            Method sendSMSWK has 11 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function sendSMSWK($userAccount, $passAccount, $numbers, $sender, $msg, $msgKey, $MsgID, $timeSend=0, $dateSend=0, $deleteKey=0, $viewResult=1)
                            Severity: Major
                            Found in src/mobilyWs/curl.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language