midasplatform/Midas

View on GitHub

Showing 1,593 of 14,443 total issues

Method indexAction has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function indexAction()
    {
        $this->disableLayout();
        $itemIds = $this->getParam('items');
        $folderIds = $this->getParam('folders');
Severity: Major
Found in core/controllers/DownloadController.php - About 6 hrs to fix

Method testCommunityCreate has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testCommunityCreate()
    {
        /** @var CommunityModel $communityModel */
        $communityModel = MidasLoader::loadModel('Community');
        $communities = $communityModel->getAll();
Severity: Major
Found in modules/api/tests/controllers/CallCommunityMethodsTest.php - About 6 hrs to fix

Function loadModuleElements has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadModuleElements()
    {
        if (isset($this->_moduleModels)) {
            MidasLoader::loadModels($this->_moduleModels, $this->moduleName);
            $modelsArray = Zend_Registry::get('models');
Severity: Minor
Found in notification/GlobalNotification.php - About 6 hrs 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 loadModuleElements has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadModuleElements()
    {
        if (isset($this->_moduleModels)) {
            MidasLoader::loadModels($this->_moduleModels, $this->moduleName);
            $modelsArray = Zend_Registry::get('models');
Severity: Minor
Found in modules/GlobalModule.php - About 6 hrs 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 ApiComponent.php has 434 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: Minor
Found in modules/api/controllers/components/ApiComponent.php - About 6 hrs to fix

File DashboardModelTest.php has 432 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: Minor
Found in modules/validation/tests/models/base/DashboardModelTest.php - About 6 hrs to fix

File ApiComponent.php has 432 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: Minor
Found in modules/tracker/controllers/components/ApiComponent.php - About 6 hrs to fix

Function getMatchingFilesRecursive has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMatchingFilesRecursive($src, $dir = '')
    {
        $files = array();
        if (!is_dir($src)) {
            $files[] = $src;
Severity: Minor
Found in tests/UTF8Tools.php - About 6 hrs 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 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static Object parse(
        XMLTokener x,
        boolean    arrayForm,
        JSONArray  ja
    ) throws JSONException {
Severity: Major
Found in modules/dicomanonymize/java/upload/src/org/json/JSONML.java - About 6 hrs to fix

Method parse has 153 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static Object parse(
        XMLTokener x,
        boolean    arrayForm,
        JSONArray  ja
    ) throws JSONException {
Severity: Major
Found in modules/javauploaddownload/java/upload/src/org/json/JSONML.java - About 6 hrs to fix

File ParaviewController.php has 419 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: Minor
Found in modules/visualize/controllers/ParaviewController.php - About 6 hrs to fix

JSONArray has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public class JSONArray {


    /**
     * The arrayList where the JSONArray's properties are kept.
Severity: Minor
Found in modules/dicomanonymize/java/upload/src/org/json/JSONArray.java - About 6 hrs to fix

JSONArray has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public class JSONArray {


    /**
     * The arrayList where the JSONArray's properties are kept.
Severity: Minor
Found in modules/javauploaddownload/java/upload/src/org/json/JSONArray.java - About 6 hrs to fix

Function _recursiveParseDirectory has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    private function _recursiveParseDirectory($path, $currentdir)
    {
        $it = new DirectoryIterator($path);
        foreach ($it as $fileInfo) {
            if ($fileInfo->isDot()) {
Severity: Minor
Found in core/controllers/ImportController.php - About 5 hrs 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 testFolderAddRemovePolicyuser has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testFolderAddRemovePolicyuser()
    {
        /** @var UserModel $userModel */
        $userModel = MidasLoader::loadModel('User');

Severity: Major
Found in modules/api/tests/controllers/CallFolderMethodsTest.php - About 5 hrs to fix

File paraview.slice.js has 407 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.

/* global JavaScriptRenderer */
/* global json */

Severity: Minor
Found in modules/visualize/public/js/paraview/paraview.slice.js - About 5 hrs to fix

Function createThumbnailFromPath has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public function createThumbnailFromPath($name, $fullPath, $width, $height, $exact = true)
    {
        /** @var SettingModel $settingModel */
        $settingModel = MidasLoader::loadModel('Setting');
        $provider = $settingModel->getValueByName(MIDAS_THUMBNAILCREATOR_PROVIDER_KEY, $this->moduleName);

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 policyCheck has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public function policyCheck($communityDao, $userDao = null, $policy = MIDAS_POLICY_READ)
    {
        if (!$communityDao instanceof CommunityDao || !is_numeric($policy)) {
            throw new Zend_Exception(
                'Error in param: communityDao should be a CommunityDao and policy should be numeric.'
Severity: Minor
Found in core/models/base/CommunityModelBase.php - About 5 hrs 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 movecopyAction has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function movecopyAction()
    {
        $copytype = $this->getParam('copytype');
        if (isset($copytype) && $copytype == 'reference') {
            $shareSubmit = true;
Severity: Major
Found in core/controllers/BrowseController.php - About 5 hrs to fix

Method indexAction has 142 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function indexAction()
    {
        $this->requireAdminPrivileges();
        $this->view->header = 'Administration';

Severity: Major
Found in core/controllers/AdminController.php - About 5 hrs to fix
Severity
Category
Status
Source
Language