Oefenweb/cakephp-edexml

View on GitHub

Showing 12 of 18 total issues

File EdexmlTest.php has 453 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
App::uses('Edexml', 'Edexml.Model');

class TestEdexml extends Edexml {

Severity: Minor
Found in Test/Case/Model/EdexmlTest.php - About 6 hrs to fix

    Method testConvertStudent has 133 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testConvertStudent() {
            $data = [
                '@key' => 'key',
                'achternaam' => 'Achternaam',
                'roepnaam' => 'Roepnaam',
    Severity: Major
    Found in Test/Case/Model/EdexmlTest.php - About 5 hrs to fix

      Method testConvertTeacher has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testConvertTeacher() {
              $data = [
                  '@key' => 'key',
                  'achternaam' => 'Achternaam',
                  'roepnaam' => 'Roepnaam',
      Severity: Major
      Found in Test/Case/Model/EdexmlTest.php - About 3 hrs to fix

        File Edexml.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        App::uses('AppModel', 'Model');
        App::uses('Xml', 'Utility');
        
        /**
        Severity: Minor
        Found in Model/Edexml.php - About 2 hrs to fix

          Method testConvertSingleItemData has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function testConvertSingleItemData() {
                  $data = [
                      'EDEX' => [
                          'school' => [
                              'schooljaar' => '2012-2013',
          Severity: Major
          Found in Test/Case/Model/EdexmlTest.php - About 2 hrs to fix

            Function convert has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function convert($data) {
                    $result = [];
            
                    $result['school'] = $this->_convertSchool($data['EDEX']['school']);
            
            
            Severity: Minor
            Found in Model/Edexml.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 _convertStudent has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _convertStudent($student) {
                    $result = [
                        'key' => null,
                        'date_of_birth' => null,
                        'gender' => null,
            Severity: Minor
            Found in Model/Edexml.php - About 1 hr to fix

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

                  protected function _convertStudent($student) {
                      $result = [
                          'key' => null,
                          'date_of_birth' => null,
                          'gender' => null,
              Severity: Minor
              Found in Model/Edexml.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 _convertTeacher has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _convertTeacher($teacher) {
                      $result = [
                          'key' => null,
                          'date_of_birth' => null,
                          'gender' => null,
              Severity: Minor
              Found in Model/Edexml.php - About 1 hr to fix

                Method convert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function convert($data) {
                        $result = [];
                
                        $result['school'] = $this->_convertSchool($data['EDEX']['school']);
                
                
                Severity: Minor
                Found in Model/Edexml.php - About 1 hr to fix

                  Function _convertTeacher has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function _convertTeacher($teacher) {
                          $result = [
                              'key' => null,
                              'date_of_birth' => null,
                              'gender' => null,
                  Severity: Minor
                  Found in Model/Edexml.php - About 45 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

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

                      protected function _convertNames($user) {
                          $result = [
                              'first_name' => '',
                              'last_name' => ''
                          ];
                  Severity: Minor
                  Found in Model/Edexml.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

                  Severity
                  Category
                  Status
                  Source
                  Language