NatLibFi/Skosmos

View on GitHub

Showing 1,049 of 1,049 total issues

The class GlobalConfig has an overall complexity of 55 which is very high. The configured complexity threshold is 50.
Open

class GlobalConfig extends BaseConfig
{
    /** Cache reference */
    private $cache;
    /** Location of the configuration file. Used for caching. */
Severity: Minor
Found in src/model/GlobalConfig.php by phpmd

The class Model has an overall complexity of 118 which is very high. The configured complexity threshold is 50.
Open

class Model
{
    /** cache for Vocabulary objects */
    private $allVocabularies = null;
    /** cache for Vocabulary objects */
Severity: Minor
Found in src/model/Model.php by phpmd

The class Vocabulary has an overall complexity of 118 which is very high. The configured complexity threshold is 50.
Open

class Vocabulary extends DataObject implements Modifiable
{
    /** cached value of URI space */
    private $urispace = null;
    private $config;
Severity: Minor
Found in src/model/Vocabulary.php by phpmd

The class Request has an overall complexity of 57 which is very high. The configured complexity threshold is 50.
Open

class Request
{
    private $lang;
    private $clang;
    private $page;
Severity: Minor
Found in src/model/Request.php by phpmd

The class GenericSparql has an overall complexity of 325 which is very high. The configured complexity threshold is 50.
Open

class GenericSparql
{
    /**
     * A SPARQL Client eg. an EasyRDF instance.
     * @property EasyRdf\Sparql\Client $client
Severity: Minor
Found in src/model/sparql/GenericSparql.php by phpmd

The class VocabularyConfig has an overall complexity of 124 which is very high. The configured complexity threshold is 50.
Open

class VocabularyConfig extends BaseConfig
{
    private $globalPlugins;
    private $pluginRegister;
    private $pluginParameters = array();
Severity: Minor
Found in src/model/VocabularyConfig.php by phpmd

The class GenericSparql has 23 public methods. Consider refactoring GenericSparql to keep number of public methods under 10.
Open

class GenericSparql
{
    /**
     * A SPARQL Client eg. an EasyRDF instance.
     * @property EasyRdf\Sparql\Client $client
Severity: Minor
Found in src/model/sparql/GenericSparql.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

The class GenericSparql has 77 non-getter- and setter-methods. Consider refactoring GenericSparql to keep number of methods under 25.
Open

class GenericSparql
{
    /**
     * A SPARQL Client eg. an EasyRDF instance.
     * @property EasyRdf\Sparql\Client $client
Severity: Minor
Found in src/model/sparql/GenericSparql.php by phpmd

TooManyMethods

Since: 0.1

A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

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

conceptMappingsApp.directive('load-concept-page', {
  mounted: (el, binding) => {
    el.loadConceptPageEvent = event => {
      binding.value() // calling the method given as the attribute value (loadMappings)
    }
Severity: Major
Found in resource/js/concept-mappings.js and 2 other locations - About 3 hrs to fix
resource/js/tab-alpha.js on lines 167..177
resource/js/tab-hierarchy.js on lines 230..240

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

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 3 locations. Consider refactoring.
Open

tabHierApp.directive('resize-window', {
  beforeMount: (el, binding) => {
    el.resizeWindowEvent = event => {
      binding.value() // calling the method given as the attribute value (setListStyle)
    }
Severity: Major
Found in resource/js/tab-hierarchy.js and 2 other locations - About 3 hrs to fix
resource/js/concept-mappings.js on lines 77..87
resource/js/tab-alpha.js on lines 167..177

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

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 3 locations. Consider refactoring.
Open

tabAlphaApp.directive('resize-window', {
  beforeMount: (el, binding) => {
    el.resizeWindowEvent = event => {
      binding.value() // calling the method given as the attribute value (setListStyle)
    }
Severity: Major
Found in resource/js/tab-alpha.js and 2 other locations - About 3 hrs to fix
resource/js/concept-mappings.js on lines 77..87
resource/js/tab-hierarchy.js on lines 230..240

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

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

Method getInfo has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getInfo($lang = null)
    {
        $ret = array();
        if (!$lang) {
            $lang = $this->getLang();
Severity: Major
Found in src/model/Vocabulary.php - About 3 hrs to fix

    File tab-hierarchy.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global Vue */
    /* global partialPageLoad, getConceptURL */
    
    const tabHierApp = Vue.createApp({
      data () {
    Severity: Minor
    Found in resource/js/tab-hierarchy.js - About 3 hrs to fix

      Method generateConceptSearchQuery has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function generateConceptSearchQuery($fields, $unique, $params, $showDeprecated = false)
          {
              $vocabs = $params->getVocabs();
              $gcl = $this->graphClause;
              $fcl = empty($vocabs) ? '' : $this->generateFromClause($vocabs);
      Severity: Major
      Found in src/model/sparql/GenericSparql.php - About 3 hrs to fix

        Function startResourceCountsApp has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function startResourceCountsApp () {
          const resourceCountsApp = Vue.createApp({
            data () {
              return {
                concepts: {},
        Severity: Major
        Found in resource/js/vocab-counts.js - About 2 hrs to fix

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

              public function newConcepts($request)
              {
                  $offset = ($request->getQueryParam('offset') && is_numeric($request->getQueryParam('offset')) && $request->getQueryParam('offset') >= 0) ? $request->getQueryParam('offset') : 0;
                  $limit = ($request->getQueryParam('limit') && is_numeric($request->getQueryParam('limit')) && $request->getQueryParam('limit') >= 0) ? $request->getQueryParam('limit') : 200;
          
          
          Severity: Major
          Found in src/controller/RestController.php and 1 other location - About 2 hrs to fix
          src/controller/RestController.php on lines 1131..1137

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

          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

              public function modifiedConcepts($request)
              {
                  $offset = ($request->getQueryParam('offset') && is_numeric($request->getQueryParam('offset')) && $request->getQueryParam('offset') >= 0) ? $request->getQueryParam('offset') : 0;
                  $limit = ($request->getQueryParam('limit') && is_numeric($request->getQueryParam('limit')) && $request->getQueryParam('limit') >= 0) ? $request->getQueryParam('limit') : 200;
          
          
          Severity: Major
          Found in src/controller/RestController.php and 1 other location - About 2 hrs to fix
          src/controller/RestController.php on lines 1118..1124

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

          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

          ConceptSearchParameters has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class ConceptSearchParameters
          {
              private $config;
              private $request;
              private $vocabs;
          Severity: Minor
          Found in src/model/ConceptSearchParameters.php - About 2 hrs to fix

            Method asJskos has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function asJskos($queryExVocabs = true, $lang = null, $hrefLink = null)
                {
                    $propertyLabel = $this->getLabel($lang, $queryExVocabs);
                    $propertyLang = $lang;
                    if (!is_string($propertyLabel)) {
            Severity: Major
            Found in src/model/ConceptMappingPropertyValue.php - About 2 hrs to fix

              Method vocabularyStatistics has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function vocabularyStatistics($request)
                  {
                      if ($this->notModified($request->getVocab())) {
                          return null;
                      }
              Severity: Major
              Found in src/controller/RestController.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language