DerDu/SPHERE-Framework

View on GitHub
Application/Transfer/Indiware/Import/Service.php

Summary

Maintainability
F
1 wk
Test Coverage

Function importIndiwareLectureship has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
Open

    public function importIndiwareLectureship()
    {

        $InfoList = array();
        $tblIndiwareImportLectureshipList = $this->getIndiwareImportLectureshipAll(true);
Severity: Minor
Found in Application/Transfer/Indiware/Import/Service.php - About 1 day 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 importIndiwareStudentCourse has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    public function importIndiwareStudentCourse()
    {

//        $InfoList = array();
        $tblIndiwareImportStudentList = $this->getIndiwareImportStudentAll(true);
Severity: Minor
Found in Application/Transfer/Indiware/Import/Service.php - About 1 day 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 Service.php has 494 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SPHERE\Application\Transfer\Indiware\Import;

use SPHERE\Application\Education\Lesson\Division\Division;
Severity: Minor
Found in Application/Transfer/Indiware/Import/Service.php - About 7 hrs to fix

    Method importIndiwareLectureship has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function importIndiwareLectureship()
        {
    
            $InfoList = array();
            $tblIndiwareImportLectureshipList = $this->getIndiwareImportLectureshipAll(true);
    Severity: Major
    Found in Application/Transfer/Indiware/Import/Service.php - About 4 hrs to fix

      Method importIndiwareStudentCourse has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function importIndiwareStudentCourse()
          {
      
      //        $InfoList = array();
              $tblIndiwareImportStudentList = $this->getIndiwareImportStudentAll(true);
      Severity: Major
      Found in Application/Transfer/Indiware/Import/Service.php - About 3 hrs to fix

        Function updateIndiwareImportStudentCourse has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

            public function updateIndiwareImportStudentCourse(
                IFormInterface $Stage = null,
                TblIndiwareImportStudent $tblIndiwareImportStudent,
                $Data = null,
                $Visible = false
        Severity: Minor
        Found in Application/Transfer/Indiware/Import/Service.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

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

        class Service extends AbstractService
        {
            /**
             * @param bool $doSimulation
             * @param bool $withData
        Severity: Minor
        Found in Application/Transfer/Indiware/Import/Service.php - About 2 hrs to fix

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

              public function getSubjectTeacherListByDivisionList($tblDivisionList = array())
              {
          
                  $SubjectTeacherList = array();
                  if (!empty($tblDivisionList)) {
          Severity: Minor
          Found in Application/Transfer/Indiware/Import/Service.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 updateIndiwareImportLectureship has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateIndiwareImportLectureship(
                  IFormInterface $Stage = null,
                  TblIndiwareImportLectureship $tblIndiwareImportLectureship,
                  $Data = null,
                  $Visible = false
          Severity: Minor
          Found in Application/Transfer/Indiware/Import/Service.php - About 1 hr to fix

            Function updateIndiwareImportLectureship has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateIndiwareImportLectureship(
                    IFormInterface $Stage = null,
                    TblIndiwareImportLectureship $tblIndiwareImportLectureship,
                    $Data = null,
                    $Visible = false
            Severity: Minor
            Found in Application/Transfer/Indiware/Import/Service.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 updateIndiwareImportStudentCourse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function updateIndiwareImportStudentCourse(
                    IFormInterface $Stage = null,
                    TblIndiwareImportStudent $tblIndiwareImportStudent,
                    $Data = null,
                    $Visible = false
            Severity: Minor
            Found in Application/Transfer/Indiware/Import/Service.php - About 1 hr to fix

              Function getDivisionListByIndiwareImportLectureship has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getDivisionListByIndiwareImportLectureship($tblIndiwareImportLectureshipList)
                  {
                      $tblDivisionList = array();
                      if (!empty($tblIndiwareImportLectureshipList)) {
                          foreach ($tblIndiwareImportLectureshipList as $tblIndiwareImportLectureship) {
              Severity: Minor
              Found in Application/Transfer/Indiware/Import/Service.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

              Avoid deeply nested control flow statements.
              Open

                                              if ($tblPerson && $tblDivision &&
                                                  Division::useService()->getDivisionStudentByDivisionAndPerson($tblDivision,
                                                      $tblPerson)
                                              ) {
                                                  if ($tblDivisionSubject) {
              Severity: Major
              Found in Application/Transfer/Indiware/Import/Service.php - About 45 mins to fix

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

                    public function destroyIndiwareImportStudentAll()
                    {
                
                        $tblAccount = Account::useService()->getAccountBySession();
                        if ($tblAccount) {
                Severity: Minor
                Found in Application/Transfer/Indiware/Import/Service.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

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

                    public function importIndiwareLectureship()
                    {
                
                        $InfoList = array();
                        $tblIndiwareImportLectureshipList = $this->getIndiwareImportLectureshipAll(true);
                Severity: Major
                Found in Application/Transfer/Indiware/Import/Service.php and 1 other location - About 4 days to fix
                Application/Transfer/Untis/Import/Service.php on lines 260..395

                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 893.

                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

                    public function updateIndiwareImportLectureship(
                        IFormInterface $Stage = null,
                        TblIndiwareImportLectureship $tblIndiwareImportLectureship,
                        $Data = null,
                        $Visible = false
                Severity: Major
                Found in Application/Transfer/Indiware/Import/Service.php and 1 other location - About 2 days to fix
                Application/Transfer/Untis/Import/Service.php on lines 108..163

                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 450.

                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

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

                    public function getSubjectTeacherListByDivisionList($tblDivisionList = array())
                    {
                
                        $SubjectTeacherList = array();
                        if (!empty($tblDivisionList)) {
                Severity: Major
                Found in Application/Transfer/Indiware/Import/Service.php and 1 other location - About 1 hr to fix
                Application/Transfer/Untis/Import/Service.php on lines 222..240

                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 117.

                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

                    public function getDivisionListByIndiwareImportLectureship($tblIndiwareImportLectureshipList)
                    {
                        $tblDivisionList = array();
                        if (!empty($tblIndiwareImportLectureshipList)) {
                            foreach ($tblIndiwareImportLectureshipList as $tblIndiwareImportLectureship) {
                Severity: Minor
                Found in Application/Transfer/Indiware/Import/Service.php and 1 other location - About 45 mins to fix
                Application/Transfer/Untis/Import/Service.php on lines 200..215

                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 96.

                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

                    public function destroyIndiwareImportLectureship(TblIndiwareImportLectureship $tblIndiwareImportLectureship = null)
                    {
                
                        if ($tblIndiwareImportLectureship == null) {
                            $tblAccount = Account::useService()->getAccountBySession();
                Severity: Minor
                Found in Application/Transfer/Indiware/Import/Service.php and 1 other location - About 40 mins to fix
                Application/Transfer/Untis/Import/Service.php on lines 181..193

                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 94.

                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