AthensFramework/core

View on GitHub

Showing 94 of 104 total issues

Method __construct has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(
        $id,
        array $classes,
        array $data,
        QueryWrapperInterface $query,
Severity: Minor
Found in src/filter/RelationFilter.php - About 1 hr to fix

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

            $id,
            $type,
            array $classes,
            array $data,
            $title,
    Severity: Major
    Found in src/page/Page.php - About 1 hr to fix

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

          public function build()
          {
              $this->validateId();
      
              $type = $this->retrieveOrException("type", __METHOD__);
      Severity: Minor
      Found in src/filter/FilterBuilder.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

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

          protected function validateOnInvalidFunc()
          {
              $this->onInvalidFunctions[] = function (FormInterface $thisForm) {
                  foreach ($thisForm->getWritableBearer()->getWritables() as $writable) {
                      if ($writable instanceof FieldInterface) {
      Severity: Minor
      Found in src/form/FormBuilderTrait.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

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

      athens.alert = (function () {
      
          /**
           * Creates an alert div, appends it to the notification area, and schedules it for removal.
           *
      Severity: Minor
      Found in assets/js/alert.js - 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

      Function sort has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      athens.sort = (function () {
          
          var setupSortFilter = function (handle) {
      
              var filterSection = $("div.sort-container[data-handle-for=" + handle + "]").closest('.table-container');
      Severity: Minor
      Found in assets/js/sort.js - About 1 hr to fix

        Function done has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var done = function (data, textStatus, jqXHR) {
                    try {
                        var formPOSTResult = $("<div>" + data + "</div>").find("#" + formId);
        
                        var formHasErrors = formPOSTResult.hasClass("has-errors");
        Severity: Minor
        Found in assets/js/ajax.js - About 1 hr to fix

          Function buildTopMatter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function buildTopMatter()
              {
                  $topMatterBuilder = SectionBuilder::begin()
                      ->setType(SectionBuilder::TYPE_SPAN);
          
          
          Severity: Minor
          Found in src/page/PageBuilder.php - About 55 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 queryFilter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function queryFilter(QueryWrapperInterface $query)
              {
                  $this->canQueryFilter = true;
                  if ($this->getNextFilter()->canQueryFilter === false) {
                      $this->canQueryFilter = false;
          Severity: Minor
          Found in src/filter/RelationFilter.php - About 55 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 queryFilter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function queryFilter(QueryWrapperInterface $query)
              {
                  $this->canQueryFilter = true;
                  if ($this->getNextFilter()->canQueryFilter === false) {
                      $this->canQueryFilter = false;
          Severity: Minor
          Found in src/filter/SortFilter.php - About 55 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 multi_adder has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          athens.multi_adder = (function () {
          
              var getLastRow = function (multiAdderTable) {
                  return multiAdderTable.find("tr.form-row").last();
              };
          Severity: Minor
          Found in assets/js/multi-adder.js - About 55 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

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

                  array $classes,
                  array $data,
                  WritableBearerInterface $writableBearer,
                  array $labels,
                  $onClick,
          Severity: Minor
          Found in src/row/Row.php - About 45 mins to fix

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

                protected function validateOnValidFunc()
                {
                    if ($this->onSuccessUrl !== null) {
                        $url = $this->onSuccessUrl;
            
            
            Severity: Minor
            Found in src/form/FormBuilderTrait.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

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

                    $id,
                    array $classes,
                    array $data,
                    QueryWrapperInterface $query,
                    $default,
            Severity: Minor
            Found in src/filter/RelationFilter.php - About 45 mins to fix

              Function call has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  var call = function (url, type, settings, data, done, fail) {
              Severity: Minor
              Found in assets/js/ajax.js - About 45 mins to fix

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

                        $id,
                        array $classes,
                        array $data,
                        array $statements,
                        $default,
                Severity: Minor
                Found in src/filter/SelectFilter.php - About 45 mins to fix

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

                          array $classes,
                          array $data,
                          $type,
                          $link = "",
                          $text = ""
                  Severity: Minor
                  Found in src/link/Link.php - About 35 mins to fix

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

                        public function __construct($id, array $classes, $maxPerPage, $page, FilterInterface $nextFilter = null)
                    Severity: Minor
                    Found in src/filter/PaginationFilter.php - About 35 mins to fix

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

                          public function __construct($id, array $classes, array $data, $type, $contents)
                      Severity: Minor
                      Found in src/script/Script.php - About 35 mins to fix

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

                            public function __construct($id, array $classes, array $data, array $statements, FilterInterface $nextFilter = null)
                        Severity: Minor
                        Found in src/filter/Filter.php - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language