midasplatform/Midas

View on GitHub

Showing 1,593 of 14,443 total issues

Method privBuildMimeArray has 983 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function privBuildMimeArray()
    {
        return array(
            '123' => 'application/vnd.lotus-1-2-3',
            '3dml' => 'text/vnd.in3d.3dml',
Severity: Major
Found in core/controllers/components/MimeTypeComponent.php - About 4 days to fix

File CallItemMethodsTest.php has 1568 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in modules/api/tests/controllers/CallItemMethodsTest.php - About 4 days to fix

Method parse has a Cognitive Complexity of 196 (exceeds 5 allowed). Consider refactoring.
Open

    private static Object parse(
        XMLTokener x,
        boolean    arrayForm,
        JSONArray  ja
    ) throws JSONException {
Severity: Minor
Found in modules/dicomanonymize/java/upload/src/org/json/JSONML.java - About 4 days 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 parse has a Cognitive Complexity of 196 (exceeds 5 allowed). Consider refactoring.
Open

    private static Object parse(
        XMLTokener x,
        boolean    arrayForm,
        JSONArray  ja
    ) throws JSONException {
Severity: Minor
Found in modules/javauploaddownload/java/upload/src/org/json/JSONML.java - About 4 days 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 settingsAction has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring.
Open

    public function settingsAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Minor
Found in core/controllers/UserController.php - About 3 days 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

File FolderModel.php has 1129 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in core/models/pdo/FolderModel.php - About 2 days to fix

File UserController.php has 1120 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in core/controllers/UserController.php - About 2 days to fix

File MimeTypeComponent.php has 1017 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in core/controllers/components/MimeTypeComponent.php - About 2 days to fix

Function preDispatch has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
Open

    public function preDispatch()
    {
        parent::preDispatch();
        $this->view->setEncoding('UTF-8');

Severity: Minor
Found in core/AppController.php - About 2 days 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 ColorPicker has 465 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var ColorPicker = function () {
        var
            ids = {},
            inAction,
            charMin = 65,
Severity: Major
Found in modules/pvw/public/js/jquery/colorpicker.js - About 2 days to fix

File convert_obj_three.py has 929 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader)

-------------------------
How to use this converter
-------------------------
Severity: Major
Found in modules/visualize/controllers/components/scripts/convert_obj_three.py - About 2 days to fix

Method testBitstreamUpload has 441 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testBitstreamUpload()
    {
        $this->resetAll();
        $itemsFile = $this->loadData('Item', 'default');

Severity: Major
Found in modules/api/tests/controllers/CallItemMethodsTest.php - About 2 days to fix

Method parse has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean parse(XMLTokener x, JSONObject context,
                                 String name) throws JSONException {
        char       c;
        int        i;
        JSONObject jsonobject = null;
Severity: Minor
Found in modules/dicomanonymize/java/upload/src/org/json/XML.java - About 2 days 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 parse has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean parse(XMLTokener x, JSONObject context,
                                 String name) throws JSONException {
        char       c;
        int        i;
        JSONObject jsonobject = null;
Severity: Minor
Found in modules/javauploaddownload/java/upload/src/org/json/XML.java - About 2 days 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 dialogAction has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
Open

    public function dialogAction()
    {
        $this->disableLayout();
        $type = $this->getParam('type');
        $element = $this->getParam('element');
Severity: Minor
Found in core/controllers/ShareController.php - About 2 days 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

File JSONObject.java has 807 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package org.json;

/*
Copyright (c) 2002 JSON.org

Severity: Major
Found in modules/javauploaddownload/java/upload/src/org/json/JSONObject.java - About 1 day to fix

File JSONObject.java has 807 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package org.json;

/*
Copyright (c) 2002 JSON.org

Severity: Major
Found in modules/dicomanonymize/java/upload/src/org/json/JSONObject.java - About 1 day to fix

Function submissionValidate has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
Open

    public function submissionValidate($args)
    {
        $this->_checkKeys(array('uuid'), $args);
        $user = $this->_getUser($args);

Severity: Minor
Found in modules/tracker/controllers/components/ApiComponent.php - About 1 day 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

File AggregateMetricModelTest.php has 775 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in modules/tracker/tests/models/base/AggregateMetricModelTest.php - About 1 day to fix

Function indexAction has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

    public function indexAction()
    {
        $this->disableLayout();
        $itemIds = $this->getParam('items');
        $folderIds = $this->getParam('folders');
Severity: Minor
Found in core/controllers/DownloadController.php - About 1 day 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