NatLibFi/Skosmos

View on GitHub

Showing 191 of 1,049 total issues

Avoid too many return statements within this method.
Open

            return $label;
Severity: Major
Found in src/model/ConceptPropertyValue.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return null;
    Severity: Major
    Found in src/model/ConceptPropertyValue.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return ($a < $b) ? -1 : 1;
      Severity: Major
      Found in src/model/DataObject.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return strcoll($a->getSortKey(), $b->getSortKey());
        Severity: Major
        Found in src/model/ConceptProperty.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $this->resource->shorten() ? $this->resource->shorten() : $this->getUri();
          Severity: Major
          Found in src/model/ConceptPropertyValue.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $this->returnJson($ret);
            Severity: Major
            Found in src/controller/RestController.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->resource->label();
              Severity: Major
              Found in src/model/ConceptPropertyValue.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->resource->getLiteral('rdf:value');
                Severity: Major
                Found in src/model/ConceptPropertyValue.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                              return strnatcasecmp($anot, $bnot);
                  Severity: Major
                  Found in src/model/ConceptProperty.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return null;
                    Severity: Major
                    Found in src/model/ConceptMappingPropertyValue.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return "";
                      Severity: Major
                      Found in src/model/Concept.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return self::DEFAULT_PROPERTY_ORDER;
                        Severity: Major
                        Found in src/model/VocabularyConfig.php - About 30 mins to fix

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

                              protected function getExternalLabel($exvoc, $exuri, $lang)
                              {
                                  if ($exvoc) {
                                      try {
                                          $exsparql = $exvoc->getSparql();
                          Severity: Minor
                          Found in src/model/DataObject.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

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

                              protected function getExternalNotation($exvoc, $exuri)
                              {
                                  if ($exvoc) {
                                      try {
                                          $exsparql = $exvoc->getSparql();
                          Severity: Minor
                          Found in src/model/DataObject.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

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

                              public function getSidebarViews()
                              {
                                  $views = $this->resource->getResource('skosmos:sidebarViews');
                                  if ($views) {
                                      $viewsArray = array();
                          Severity: Minor
                          Found in src/model/VocabularyConfig.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

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

                              public function data($request)
                              {
                                  $vocab = $request->getVocab();
                                  if ($this->notModified($request->getVocab())) {
                                      return null;
                          Severity: Minor
                          Found in src/controller/RestController.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

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

                          const updateJsonLD = (conceptHTML) => {
                            const JsonLD = document.querySelector('script[type="application/ld+json"]')
                            const newJsonLD = conceptHTML.querySelector('script[type="application/ld+json"]')
                            if (JsonLD) {
                              JsonLD.innerHTML = '{}'
                          Severity: Minor
                          Found in resource/js/partial-page-load.js - 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

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

                              public function mappings(Request $request)
                              {
                                  $this->model->setLocale($request->getLang());
                                  $vocab = $request->getVocab();
                                  if ($this->notModified($vocab)) {
                          Severity: Minor
                          Found in src/controller/RestController.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

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

                              parseSearchLang () {
                                // if content language can be found from uri params, use that and update it to SKOSMOS object and to search lang cookie
                                const urlParams = new URLSearchParams(window.location.search)
                                const paramLang = urlParams.get('clang')
                                const anyLang = urlParams.get('anylang')
                          Severity: Minor
                          Found in resource/js/vocab-search.js - 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

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

                              private function setPluginParameters(Easyrdf\Resource $pluginResource): void
                              {
                                  $pluginName = $pluginResource->getLiteral('skosmos:usePlugin')->getValue();
                                  $this->pluginParameters[$pluginName] = array();
                          
                          
                          Severity: Minor
                          Found in src/model/VocabularyConfig.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