axsh/wakame-vdc

View on GitHub

Showing 893 of 1,587 total issues

Function resourceManagePanel has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.resourceManagePanel = function(){
  // ボタン名
  var create_button_name = $.i18n.prop('create_button');
  var close_button_name = $.i18n.prop('close_button');
  var update_button_name = $.i18n.prop('update_button');

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 load_balancer_panel.js has 724 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.loadBalancerPanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {

Function networkPanel has 333 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.networkPanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = { 
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/network_panel.js - About 1 day to fix

File network.rb has 709 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'ipaddress'

module Dcmgr::Cli
class Network < Base
  namespace :network
Severity: Major
Found in dcmgr/lib/dcmgr/cli/network.rb - About 1 day to fix

File underscore.js has 700 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//     Underscore.js 1.3.3
//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
//     Underscore may be freely distributed under the MIT license.
//     Portions of Underscore are inspired or borrowed from Prototype,
//     Oliver Steele's Functional, and John Resig's Micro-Templating.
Severity: Major
Found in frontend/admin/app/assets/javascripts/underscore.js - About 1 day to fix

File date.js has 671 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// -----
// The `timezoneJS.Date` object gives you full-blown timezone support, independent from the timezone set on the end-user's machine running the browser. It uses the Olson zoneinfo files for its timezone data.
//
// The constructor function and setter methods use proxy JavaScript Date objects behind the scenes, so you can use strings like '10/22/2006' with the constructor. You also get the same sensible wraparound behavior with numeric parameters (like setting a value of 14 for the month wraps around to the next March).
//
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/date.js - About 1 day to fix

File instances.rb has 663 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'dcmgr/endpoints/12.03/responses/instance'
require 'dcmgr/endpoints/12.03/responses/instance_password'
require 'dcmgr/endpoints/12.03/responses/volume'
require 'multi_json'

Severity: Major
Found in dcmgr/lib/dcmgr/endpoints/12.03/instances.rb - About 1 day to fix

File instance_panel.js has 651 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.instancePanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 day to fix

Function usersPanel has 290 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.usersPanel = function(){
  // Core.jsのクラス利用の初期設定
  var total = 0;
  var maxrow = 10;
  var page = 1;
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/users_panel.js - About 1 day to fix

Function _injectTimePicker has 286 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _injectTimePicker: function() {
        var $dp = this.inst.dpDiv,
            o = this._defaults,
            tp_inst = this,
            // Added by Peter Medeiros:
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 day to fix

Function groupsPanel has 252 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.groupsPanel = function(){
  // Core.jsのクラス利用の初期設定
  var total = 0;
  var maxrow = 10;
  var page = 1;
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/groups_panel.js - About 1 day to fix

Function callback has 251 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      callback: function(){
        var self = this;

        $(this).find('#left_select_list').mask($.i18n.prop('loading_parts'));
        $(this).find('#right_select_list').mask($.i18n.prop('loading_parts'));
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/instance_panel.js - About 1 day to fix

Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ajax: function( url, options ) {

        // If url is an object, simulate pre-1.5 signature
        if ( typeof url === "object" ) {
            options = url;
Severity: Major
Found in frontend/admin/app/assets/javascripts/jquery-1.8.0.js - About 1 day to fix

Function _init has 236 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _init: function() {
        var self = this, o = this.options;
        var menu_toggle_flag = 0;
        //quick array of button and menu id's
        this.ids = [this.element.attr('id') + '-' + 'button', this.element.attr('id') + '-' + 'menu'];
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/ui.selectmenu.js - About 1 day to fix

File load_balancers.rb has 554 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'dcmgr/endpoints/12.03/responses/load_balancer'
require 'sinatra/internal_request'
require 'amqp'

Dcmgr::Endpoints::V1203::CoreAPI.namespace '/load_balancers' do
Severity: Major
Found in dcmgr/lib/dcmgr/endpoints/12.03/load_balancers.rb - About 1 day to fix

Method make_tag_endpoint has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    def self.make_tag_endpoint(tag_subclass,mapped_resource)
      Proc.new do

        get do
          # description 'Show lists of the host node groups'
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/tag/tag_endpoint_factory.rb - 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 backupPanel has 231 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.backupPanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = { 
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/backup_panel.js - About 1 day to fix

File backbone.paginator.js has 537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*globals Backbone:true, _:true, jQuery:true*/
Backbone.Paginator = (function ( Backbone, _, $ ) {
    "use strict";

    var Paginator = {};
Severity: Major
Found in frontend/admin/app/assets/javascripts/backbone.paginator.js - About 1 day to fix

Function callback has 215 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    callback: function(){
        var is_accid = '';
        var is_uuid = '';
        // jqGridの定義(追加ドライブ)
    jQuery("#list").jqGrid({

Function Enumerable has 209 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Enumerable = (function() {
  function each(iterator, context) {
    var index = 0;
    try {
      this._each(function(value) {
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/prototype.js - About 1 day to fix
Severity
Category
Status
Source
Language