NatLibFi/Skosmos

View on GitHub

Showing 191 of 1,049 total issues

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

    public function label($request)
    {
        if (!$request->getUri()) {
            return $this->returnError(400, "Bad Request", "uri parameter missing");
        }
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 arbitrarySort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function arbitrarySort($sortable)
    {
        // sorting the result list to a arbitrary order defined below in mycompare()
        if ($sortable !== null) {
            uksort($sortable, array($this, 'mycompare'));
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 getVocabularyByGraph has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getVocabularyByGraph($graph, $endpoint = null)
    {
        if ($endpoint === null) {
            $endpoint = $this->getConfig()->getDefaultEndpoint();
        }
Severity: Minor
Found in src/model/Model.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 getDefaultSidebarView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultSidebarView()
    {
        $defview = $this->resource->getLiteral('skosmos:defaultSidebarView');
        $sidebarViews = $this->getSidebarViews();
        if ($defview) {
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 getDefaultConceptSidebarView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultConceptSidebarView()
    {
        $defview = $this->resource->getLiteral('skosmos:defaultConceptSidebarView');
        $sidebarViews = $this->getSidebarViews();
        if ($defview) {
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 redirect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function redirect($request)
    {
        /* determine parameters: URI and (optional) vocabulary */
        $request->setUri($request->getQueryParam('uri'));
        if ($request->getQueryParam('vocab')) {
Severity: Minor
Found in src/controller/EntityController.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 getVocabGraphs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getVocabGraphs($vocabs)
    {
        if ($vocabs === null || sizeof($vocabs) == 0) {
            // searching from all vocabularies - limit to known graphs
            $vocabs = $this->model->getVocabularies();
Severity: Minor
Found in src/model/sparql/GenericSparql.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 redirectWeb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function redirectWeb($vocab, $uri)
    {
        $baseurl = $this->getBaseHref();
        $vocid = $vocab->getId();
        $localname = $vocab->getLocalName($uri);
Severity: Minor
Found in src/controller/EntityController.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 invokeVocabularySearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function invokeVocabularySearch($request)
    {
        $template = $this->twig->load('vocab-search.twig');
        $this->model->setLocale($request->getLang());
        $vocab = $request->getVocab();
Severity: Minor
Found in src/controller/WebController.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 getModifiedDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModifiedDate()
    {
        $modifiedDate = null;

        $conceptSchemeURI = $this->getDefaultConceptScheme();
Severity: Minor
Found in src/model/Vocabulary.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 getTemplates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTemplates($names = null)
    {
        $templateStrings = array();
        $plugins = $this->getPluginsTemplates($names);
        foreach ($plugins as $folder => $templates) {
Severity: Minor
Found in src/model/PluginRegister.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