AthensFramework/core

View on GitHub

Showing 94 of 104 total issues

Function ajax_section has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

athens.ajax_section = (function () {

    /**
     * The set of get variables which shall be included when requesting a section
     *
Severity: Minor
Found in assets/js/ajax-section.js - About 7 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

Function ajax_section has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

athens.ajax_section = (function () {

    /**
     * The set of get variables which shall be included when requesting a section
     *
Severity: Major
Found in assets/js/ajax-section.js - About 5 hrs to fix

    Function soft_pagination has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    athens.soft_pagination = (function () {
    
        var page, rows, table, paginateBy, numPages, select, div;
    
        page = 1;
    Severity: Major
    Found in assets/js/soft-pagination.js - About 5 hrs to fix

      Field has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Field implements FieldInterface
      {
          use WritableTrait;
      
          /** @var bool  */
      Severity: Minor
      Found in src/field/Field.php - About 4 hrs to fix

        Function multi_panel has 119 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        athens.multi_panel = (function () {
        
            /**
             * Private method for creating a slider panel.
             *
        Severity: Major
        Found in assets/js/multi-panel.js - About 4 hrs to fix

          Function visitPage has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              public function visitPage(PageInterface $page)
              {
                  /** @var WritableInterface[] $writables */
                  $writables = [$page];
          
          
          Severity: Minor
          Found in src/writer/ExcelWriter.php - About 4 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

          Function ajax has 111 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          athens.ajax = (function () {
          
              /**
               * Private method which encapsulates retrieving the CSRFTOKEN global.
               *
          Severity: Major
          Found in assets/js/ajax.js - About 4 hrs to fix

            Function ajax has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            athens.ajax = (function () {
            
                /**
                 * Private method which encapsulates retrieving the CSRFTOKEN global.
                 *
            Severity: Minor
            Found in assets/js/ajax.js - About 4 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

            Function search has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            athens.search = (function () {
            
                var searchDiv = $(".search-div");
            
                /**
            Severity: Major
            Found in assets/js/search.js - About 3 hrs to fix

              Function pagination has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              athens.pagination = (function () {
              
                  var getPaginationContainer = function (handle) {
                      return $("div.pagination-container[data-handle-for=" + handle +"]");
                  };
              Severity: Major
              Found in assets/js/pagination.js - About 3 hrs to fix

                Function soft_pagination has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                athens.soft_pagination = (function () {
                
                    var page, rows, table, paginateBy, numPages, select, div;
                
                    page = 1;
                Severity: Minor
                Found in assets/js/soft-pagination.js - About 3 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

                Function validate has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function validate()
                    {
                        $this->isValid = true;
                
                        foreach ($this->getWritableBearer()->getWritables() as $name => $writable) {
                Severity: Minor
                Found in src/form/Form.php - About 3 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 build has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function build()
                    {
                        $this->validateId();
                
                        $type = $this->retrieveOrException("type", __METHOD__);
                Severity: Major
                Found in src/filter/FilterBuilder.php - About 3 hrs to fix

                  Method getEnvironment has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function getEnvironment()
                      {
                          if ($this->environment === null) {
                              $loader = new \Twig_Loader_Filesystem($this->getTemplatesDirectories());
                              $this->environment = new \Twig_Environment($loader);
                  Severity: Major
                  Found in src/writer/TwigTemplateWriter.php - About 2 hrs to fix

                    Function multi_adder has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    athens.multi_adder = (function () {
                    
                        var getLastRow = function (multiAdderTable) {
                            return multiAdderTable.find("tr.form-row").last();
                        };
                    Severity: Major
                    Found in assets/js/multi-adder.js - About 2 hrs to fix

                      Function multi_panel has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                      athens.multi_panel = (function () {
                      
                          /**
                           * Private method for creating a slider panel.
                           *
                      Severity: Minor
                      Found in assets/js/multi-panel.js - 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 makeDetail has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function makeDetail()
                          {
                              /** @var boolean $idWasProvided */
                              $idWasProvided = static::getObjectId() !== null;
                      
                      
                      Severity: Major
                      Found in src/admin/Admin.php - About 2 hrs to fix

                        Method makeTables has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function makeTables($queries = null)
                            {
                                /** @var WritableInterface[] $tables */
                                $tables = [];
                        
                        
                        Severity: Major
                        Found in src/admin/Admin.php - About 2 hrs to fix

                          Method visitPage has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function visitPage(PageInterface $page)
                              {
                                  /** @var WritableInterface[] $writables */
                                  $writables = [$page];
                          
                          
                          Severity: Major
                          Found in src/writer/ExcelWriter.php - About 2 hrs to fix

                            File Admin.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            namespace Athens\Core\Admin;
                            
                            use Athens\Core\Etc\StringUtils;
                            Severity: Minor
                            Found in src/admin/Admin.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language