fossasia/engelsystem

View on GitHub
includes/model/User_model.php

Summary

Maintainability
F
4 days
Test Coverage

File User_model.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * User model
 */
Severity: Minor
Found in includes/model/User_model.php - About 5 hrs to fix

    Method insert_user has 25 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function insert_user($default_theme, $nick, $prename, $lastname, $age, $tel, $dect, $native_lang, $other_langs, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $current_city, $organization_web, $timezone, $planned_arrival_date) {
    Severity: Major
    Found in includes/model/User_model.php - About 3 hrs to fix

      Method User_insert has 21 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function User_insert($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $organization_web, $timezone, $planned_arrival_date) {
      Severity: Major
      Found in includes/model/User_model.php - About 2 hrs to fix

        Method update_user has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function update_user($eNick, $eName, $eVorname, $eTelefon, $eHandy, $eAlter, $eDECT, $eemail, $email_shiftinfo, $ejabber, $eSize, $eGekommen, $eAktiv, $force_active, $eTshirt, $Hometown, $id) {
        Severity: Major
        Found in includes/model/User_model.php - About 2 hrs to fix

          Method update_user_details has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function update_user_details($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $hometown, $planned_arrival_date, $planned_departure_date, $timezone, $uid) {
          Severity: Major
          Found in includes/model/User_model.php - About 2 hrs to fix

            Method insert_user has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function insert_user($default_theme, $nick, $prename, $lastname, $age, $tel, $dect, $native_lang, $other_langs, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $current_city, $organization_web, $timezone, $planned_arrival_date) {
              return sql_query("
                      INSERT INTO `User` SET
                      `color`='" . sql_escape($default_theme) . "',
                      `Nick`='" . sql_escape($nick) . "',
            Severity: Minor
            Found in includes/model/User_model.php - About 1 hr to fix

              Method User_update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function User_update($user) {
                return sql_query("UPDATE `User` SET
                    `Nick`='" . sql_escape($user['Nick']) . "',
                    `Name`='" . sql_escape($user['Name']) . "',
                    `Vorname`='" . sql_escape($user['Vorname']) . "',
              Severity: Minor
              Found in includes/model/User_model.php - About 1 hr to fix

                Method User_insert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function User_insert($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $organization_web, $timezone, $planned_arrival_date) {
                  return  sql_query("
                            INSERT INTO `User` SET
                            `Nick`='" . sql_escape($nick) . "',
                            `Vorname`='" . sql_escape($prename) . "',
                Severity: Minor
                Found in includes/model/User_model.php - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    return sql_query("
                        UPDATE `User` SET
                        `Nick`='" . sql_escape($nick) . "',
                        `Vorname`='" . sql_escape($prename) . "',
                        `Name`='" . sql_escape($lastname) . "',
                  Severity: Major
                  Found in includes/model/User_model.php and 1 other location - About 7 hrs to fix
                  includes/model/User_model.php on lines 589..607

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 241.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    return sql_query("
                            INSERT INTO `User` SET
                            `color`='" . sql_escape($default_theme) . "',
                            `Nick`='" . sql_escape($nick) . "',
                            `Vorname`='" . sql_escape($prename) . "',
                  Severity: Major
                  Found in includes/model/User_model.php and 1 other location - About 7 hrs to fix
                  includes/model/User_model.php on lines 674..691

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 241.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  function update_user_sn($twitter, $facebook, $github, $uid) {
                    return   sql_query("
                        UPDATE `User` SET
                        `twitter`='" . sql_escape($twitter) . "',
                        `facebook`='" . sql_escape($facebook) . "',
                  Severity: Minor
                  Found in includes/model/User_model.php and 1 other location - About 30 mins to fix
                  includes/model/ShiftTypes_model.php on lines 19..25

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 90.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status