midasplatform/Midas

View on GitHub

Showing 1,593 of 14,443 total issues

Method preDispatch has 255 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in core/AppController.php - About 1 day to fix

File common.browser.js has 589 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

/* global json */

var midas = midas || {};
Severity: Major
Found in core/public/js/common/common.browser.js - About 1 day to fix

File producer.aggregateMetric.js has 587 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

/* global ajaxWebApi */
/* global json */

Severity: Major
Found in modules/tracker/public/js/producer/producer.aggregateMetric.js - About 1 day to fix

File ApiComponentControllerTest.php has 578 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/validation/tests/controllers/ApiComponentControllerTest.php - About 1 day to fix

File Main.java has 570 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Midas Server
 * Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 * All rights reserved.
 * For more information visit http://www.kitware.com/.

File jquery.treeTable.js has 564 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

/* global callbackCheckboxes */
/* global callbackCreateElement */
/* global callbackCustomElements */
Severity: Major
Found in core/public/js/layout/jquery.treeTable.js - About 1 day to fix

Function volumeAction has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function volumeAction()
    {
        $jsImports = $this->getParam('jsImports');
        if (isset($jsImports)) {
            $this->view->jsImports = explode(';', $jsImports);
Severity: Minor
Found in modules/visualize/controllers/ParaviewController.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

Function parse_obj has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

def parse_obj(fname):
    """Parse OBJ file.
    """

    vertices = []
Severity: Minor
Found in modules/visualize/controllers/components/scripts/convert_obj_three.py - 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 ItemModel.php has 541 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/ItemModel.php - About 1 day to fix

Function parse_mtl has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

def parse_mtl(fname):
    """Parse MTL file.
    """

    materials = {}
Severity: Minor
Found in modules/visualize/controllers/components/scripts/convert_obj_three.py - 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 ItemController.php has 523 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/ItemController.php - About 1 day to fix

Function __construct has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($logged, $session)
    {
        $modules = Zend_Registry::get('modulesEnable');
        foreach ($modules as $module) {
            if (file_exists(BASE_PATH.'/modules/'.$module.'/Notification.php')) {
Severity: Minor
Found in notification/MIDASNotifier.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

Function sliceAction has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    public function sliceAction()
    {
        $operations = $this->getParam('operations');
        if (!isset($operations)) {
            $operations = '';
Severity: Minor
Found in modules/visualize/controllers/ParaviewController.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

Method _createFolderForItem has 209 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _createFolderForItem($collectionId, $parentFolderid)
    {
        /** @var FolderModel $Folder */
        $Folder = MidasLoader::loadModel('Folder');

Severity: Major
Found in core/controllers/components/MIDAS2MigrationComponent.php - About 1 day to fix

JSONObject has 58 methods (exceeds 20 allowed). Consider refactoring.
Open

public class JSONObject {

    /**
     * JSONObject.NULL is equivalent to the value that JavaScript calls null,
     * whilst Java's null is equivalent to the value that JavaScript calls
Severity: Major
Found in modules/dicomanonymize/java/upload/src/org/json/JSONObject.java - About 1 day to fix

JSONObject has 58 methods (exceeds 20 allowed). Consider refactoring.
Open

public class JSONObject {

    /**
     * JSONObject.NULL is equivalent to the value that JavaScript calls null,
     * whilst Java's null is equivalent to the value that JavaScript calls
Severity: Major
Found in modules/javauploaddownload/java/upload/src/org/json/JSONObject.java - About 1 day to fix

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

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

Severity: Minor
Found in core/controllers/AdminController.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

Method manageAction has 197 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');
Severity: Major
Found in core/controllers/CommunityController.php - About 7 hrs to fix

Method viewAction has 195 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Major
Found in core/controllers/ItemController.php - About 7 hrs to fix

Method dialogAction has 195 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function dialogAction()
    {
        $this->disableLayout();
        $type = $this->getParam('type');
        $element = $this->getParam('element');
Severity: Major
Found in core/controllers/ShareController.php - About 7 hrs to fix
Severity
Category
Status
Source
Language