NatLibFi/Skosmos

View on GitHub

Showing 1,049 of 1,049 total issues

Avoid too many return statements within this method.
Open

        return $hits;
Severity: Major
Found in src/controller/RestController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $hits;
    Severity: Major
    Found in src/controller/RestController.php - About 30 mins to fix

      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

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

                          fetchWithAbort(pageUri, 'concept')
                            .then(data => {
                              return data.text()
                            })
                            .then(data => {
                        Severity: Minor
                        Found in resource/js/partial-page-load.js and 1 other location - About 30 mins to fix
                        resource/js/tab-alpha.js on lines 68..86

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

                        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

                              fetchWithAbort(url, 'alpha')
                                .then(data => {
                                  return data.json()
                                })
                                .then(data => {
                        Severity: Minor
                        Found in resource/js/tab-alpha.js and 1 other location - About 30 mins to fix
                        resource/js/partial-page-load.js on lines 81..111

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

                        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

                        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

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

                                    const url = 'rest/v1/' + window.SKOSMOS.vocab + '/mappings?uri=' + window.SKOSMOS.uri + '&external=true&lang=' + window.SKOSMOS.lang + '&clang=' + window.SKOSMOS.content_lang
                              Severity: Minor
                              Found in resource/js/concept-mappings.js and 1 other location - About 30 mins to fix
                              resource/js/tab-hierarchy.js on lines 66..66

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

                              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

                                    fetch('rest/v1/' + window.SKOSMOS.vocab + '/hierarchy/?uri=' + window.SKOSMOS.uri + '&lang=' + window.SKOSMOS.content_lang)
                              Severity: Minor
                              Found in resource/js/tab-hierarchy.js and 1 other location - About 30 mins to fix
                              resource/js/concept-mappings.js on lines 26..26

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

                              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

                              Missing class import via use statement (line '182', column '42').
                              Open

                                          $commitDate->setTimezone(new \DateTimeZone('UTC'));
                              Severity: Minor
                              Found in src/controller/Controller.php by phpmd

                              MissingImport

                              Since: 2.7.0

                              Importing all external classes in a file through use statements makes them clearly visible.

                              Example

                              function make() {
                                  return new \stdClass();
                              }

                              Source http://phpmd.org/rules/cleancode.html#MissingImport

                              Missing class import via use statement (line '428', column '27').
                              Open

                                      $parameters = new ConceptSearchParameters($request, $this->model->getConfig());
                              Severity: Minor
                              Found in src/controller/WebController.php by phpmd

                              MissingImport

                              Since: 2.7.0

                              Importing all external classes in a file through use statements makes them clearly visible.

                              Example

                              function make() {
                                  return new \stdClass();
                              }

                              Source http://phpmd.org/rules/cleancode.html#MissingImport

                              Severity
                              Category
                              Status
                              Source
                              Language