ankitjain28may/registration-module

View on GitHub

Showing 12 of 20 total issues

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

    public function authLogin($data)
    {
         $data = $this->emptyValue($data);

         $login = $data["login"];
Severity: Minor
Found in source/Login.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 authRegister has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function authRegister($data)
    {
        $data = $this->emptyValue($data);
        $name = $data["name"];
        $email = $data["email"];
Severity: Major
Found in source/Register.php - About 2 hrs to fix

    Method authLogin has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function authLogin($data)
        {
             $data = $this->emptyValue($data);
    
             $login = $data["login"];
    Severity: Major
    Found in source/Login.php - About 2 hrs to fix

      Function registerCheck has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function registerCheck() {
          var name = $("#name").val();
          var email = $("#email").val();
          var username = $("#username").val();
          var mob = $("#mob").val();
      Severity: Minor
      Found in js/register_validate.js - About 1 hr to fix

        Function loginCheck has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function loginCheck()
        {
            var login = $("#login").val();
            var password = $("#passLogin").val();
            initLogin();
        Severity: Minor
        Found in js/login_validate.js - About 1 hr to fix

          Function loginCheck has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function loginCheck()
          {
              var login = $("#login").val();
              var password = $("#passLogin").val();
              initLogin();
          Severity: Minor
          Found in js/login_validate.js - 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 registerCheck has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function registerCheck() {
              var name = $("#name").val();
              var email = $("#email").val();
              var username = $("#username").val();
              var mob = $("#mob").val();
          Severity: Minor
          Found in js/register_validate.js - 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 login has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function login()
          {
              var re = /^\S+@/;
              var val = $("#login").val();
              $("input#login").prev("span").remove();
          Severity: Minor
          Found in js/login_validate.js - About 1 hr to fix

            Function authRegister has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function authRegister($data)
                {
                    $data = $this->emptyValue($data);
                    $name = $data["name"];
                    $email = $data["email"];
            Severity: Minor
            Found in source/Register.php - About 55 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

            Avoid too many return statements within this method.
            Open

                        return json_encode(
                            [
                            "Error" => "You are not registered, " . $this->connect->error
                            ]
                        );
            Severity: Major
            Found in source/Login.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return json_encode($this->error);
              Severity: Major
              Found in source/Login.php - About 30 mins to fix

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

                function login()
                {
                    var re = /^\S+@/;
                    var val = $("#login").val();
                    $("input#login").prev("span").remove();
                Severity: Minor
                Found in js/login_validate.js - 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

                Severity
                Category
                Status
                Source
                Language