axsh/wakame-vdc

View on GitHub

Showing 893 of 1,587 total issues

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

      class NetfilterCache
        include Dcmgr::Logger
        include CacheErrors

        EMPTY_CACHE_SET = {
Severity: Major
Found in dcmgr/lib/dcmgr/edge_networking/netfilter/cache.rb - About 1 day to fix

Function securityGroupPanel has 208 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Methods has 55 functions (exceeds 20 allowed). Consider refactoring.
Open

Element.Methods = {
  visible: function(element) {
    return $(element).style.display != 'none';
  },

Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/prototype.js - About 7 hrs to fix

Function imagePanel has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

DcmgrGUI.prototype.imagePanel = function(){
  var total = 0;
  var maxrow = 10;
  var page = 1;
  var list_request = {
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 7 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 sshKeyPairPanel has 191 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function loadBalancerPanel has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    def bulk_update
      input_uuids = []
      new_items = []
      params['monitors'].each {|idx, m|
        if m['uuid']
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/12.03/network_vifs.rb - About 7 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 to_hash has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def to_hash
      h = super

      h.merge!({:image=>image.to_hash,
                 :host_node=> (host_node.nil? ? nil : host_node.to_hash),
Severity: Minor
Found in dcmgr/lib/dcmgr/models/instance.rb - About 7 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 callback has 185 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    callback: function(){
      var self = this;

      var loading_image = DcmgrGUI.Util.getLoadingImage('boxes');
      $(this).find('#select_ssh_key_pair').empty().html(loading_image);
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/image_panel.js - About 7 hrs to fix

File kvm.rb has 471 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'net/telnet'
require 'timeout'
require 'base64'

module Dcmgr
Severity: Minor
Found in dcmgr/lib/dcmgr/drivers/hypervisor/linux_hypervisor/kvm.rb - About 7 hrs to fix

File ui.selectmenu.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
Open

 /*
 * jQuery UI selectmenu
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
Severity: Minor
Found in frontend/dcmgr_gui/public/javascripts/ui.selectmenu.js - About 7 hrs to fix

File 0002_v1203.rb has 463 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Sequel.migration do
  up do
    alter_table(:host_nodes) do
      # HostNode is no longer an account associated resource.
      drop_column :account_id
Severity: Minor
Found in dcmgr/config/db/migrations/0002_v1203.rb - About 7 hrs to fix

Method add_vnic has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

        def add_vnic(vnic_id)
          result = @rpc.request('hva-collector', 'get_netfilter_vnic_with_node_id', vnic_id)

          raise VNicNotFoundError, "VNic #{vnic_id} doesn't exist" if result.nil?
          if result[:vnic][:security_groups].empty?
Severity: Minor
Found in dcmgr/lib/dcmgr/edge_networking/netfilter/cache.rb - About 7 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 metadata.rb has 461 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'extlib'
require 'sinatra/base'
require 'sinatra/sequel_transaction'
require 'yaml'
require 'json'
Severity: Minor
Found in dcmgr/lib/dcmgr/endpoints/metadata.rb - About 7 hrs to fix

File task_manager.rb has 460 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Dcmgr
  module EdgeNetworking
    module Netfilter

      # Abstract class for task managers that apply netfilter to extend.
Severity: Minor
Found in dcmgr/lib/dcmgr/edge_networking/netfilter/task_manager.rb - About 7 hrs to fix

File cache.rb has 458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Dcmgr
  module EdgeNetworking
    module Netfilter

      module CacheErrors
Severity: Minor
Found in dcmgr/lib/dcmgr/edge_networking/netfilter/cache.rb - About 7 hrs to fix

File base_new.rb has 456 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'sequel/model'


module Dcmgr::Models
  # Sequal::Model plugin to inject the Taggable feature to the model
Severity: Minor
Found in dcmgr/lib/dcmgr/models/base_new.rb - About 6 hrs to fix

Method register_instance has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    def register_instance(instance)
      title2pmonitors = {}
      instance.monitor_items.each_pair { |k, v|
        if v[:title] =~ /^PROCESS$/
          title2pmonitors[v[:title]]=v.merge({:uuid=>k})
Severity: Minor
Found in dcmgr/lib/dcmgr/drivers/public_zabbix.rb - 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 hva_handler.rb has 448 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'isono'
require 'fileutils'
require 'ipaddress'
require 'yaml'

Severity: Minor
Found in dcmgr/lib/dcmgr/rpc/hva_handler.rb - About 6 hrs to fix

Function MONITOR_ITEMS has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

DcmgrGUI.VifMonitorSelector.MONITOR_ITEMS = (function(){
  return {
    'PING': {
      title: 'Ping',
      ui: function (elem, params){
Severity: Major
Found in frontend/dcmgr_gui/public/javascripts/dcmgr_gui/core.js - About 6 hrs to fix
Severity
Category
Status
Source
Language