adwalvekar/iecse-app

View on GitHub

Showing 4 of 4 total issues

Method insert_entries has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function insert_entries($con,$username,$email,$password,$mobile,$reg_no)
Severity: Minor
Found in iecse-app-backend/registration.php - About 45 mins to fix

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function __construct($name,$username,$password,$email,$mobile,$registrationNumber)
    Severity: Minor
    Found in iecse-app-backend/classes/register.php - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

       if(isset($fullname) && isset($username) && isset($password) && isset($email) && isset($mobile) && isset($regno))
       {
       $user=new Register($fullname,$username,$password,$email,$mobile,$regno);
       if(!$user->validate())
       {
      Severity: Major
      Found in iecse-app-backend/register.php - About 40 mins to fix

        Function readEvents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function readEvents($dat,$month,$year){
                global $conn;
                $que="SELECT * FROM events WHERE month>=$month AND date>=$dat AND year>=$year";
                $re1=mysqli_query($conn,$que);
                if(mysqli_num_rows($re1)>=1){
        Severity: Minor
        Found in iecse-app-backend/calendar.php - About 35 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