sibprogrammer/owp

View on GitHub

Showing 108 of 803 total issues

File hardware_server.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class HardwareServer < ActiveRecord::Base
  include ApplicationHelper

  attr_accessible :host, :auth_key, :description, :daemon_port, :use_ssl
  validates_uniqueness_of :host
Severity: Minor
Found in app/models/hardware_server.rb - About 2 hrs to fix

    Method create_backup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.create_backup(virtual_server, ve_state, description)
        orig_ve_state = virtual_server.state
        if 'running' == orig_ve_state
          case ve_state
            when 'suspend' then virtual_server.suspend
    Severity: Minor
    Found in app/models/backup.rb - About 2 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 stat_details has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      def stat_details
        @virtual_server = VirtualServer.find_by_id(params[:id])
        redirect_to :controller => 'dashboard' and return if !@virtual_server or !@current_user.can_control(@virtual_server)
    
        @up_level = '/admin/virtual-servers/show?id=' + @virtual_server.id.to_s
    Severity: Minor
    Found in app/controllers/admin/virtual_servers_controller.rb - About 2 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 ext-lang-pl.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Ext JS Library 3.2.1
     * Copyright(c) 2006-2010 Ext JS, Inc.
     * licensing@extjs.com
     * http://www.extjs.com/license
    Severity: Minor
    Found in public/ext/locale/ext-lang-pl.js - About 2 hrs to fix

      Method owp_CreateAccount has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function owp_CreateAccount($params)
      {
          # ** The variables listed below are passed into all module functions **
      
          $serviceid = $params["serviceid"]; # Unique ID of the product/service in the WHMCS Database
      Severity: Major
      Found in utils/whmcs/owp/owp.php - About 2 hrs to fix

        File ext-lang-pt_PT.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
         * Ext JS Library 3.2.1
         * Copyright(c) 2006-2010 Ext JS, Inc.
         * licensing@extjs.com
         * http://www.extjs.com/license
        Severity: Minor
        Found in public/ext/locale/ext-lang-pt_PT.js - About 2 hrs to fix

          File ext-lang-hu.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * Ext JS Library 3.2.1
           * Copyright(c) 2006-2010 Ext JS, Inc.
           * licensing@extjs.com
           * http://www.extjs.com/license
          Severity: Minor
          Found in public/ext/locale/ext-lang-hu.js - About 2 hrs to fix

            File ext-lang-el_GR.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * Ext JS Library 3.2.1
             * Copyright(c) 2006-2010 Ext JS, Inc.
             * licensing@extjs.com
             * http://www.extjs.com/license
            Severity: Minor
            Found in public/ext/locale/ext-lang-el_GR.js - About 2 hrs to fix

              File ext-lang-fi.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*!
               * Ext JS Library 3.2.1
               * Copyright(c) 2006-2010 Ext JS, Inc.
               * licensing@extjs.com
               * http://www.extjs.com/license
              Severity: Minor
              Found in public/ext/locale/ext-lang-fi.js - About 2 hrs to fix

                File ext-lang-tr.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*!
                 * Ext JS Library 3.2.1
                 * Copyright(c) 2006-2010 Ext JS, Inc.
                 * licensing@extjs.com
                 * http://www.extjs.com/license
                Severity: Minor
                Found in public/ext/locale/ext-lang-tr.js - About 2 hrs to fix

                  File ext-lang-pt_BR.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*!
                   * Ext JS Library 3.2.1
                   * Copyright(c) 2006-2010 Ext JS, Inc.
                   * licensing@extjs.com
                   * http://www.extjs.com/license
                  Severity: Minor
                  Found in public/ext/locale/ext-lang-pt_BR.js - About 2 hrs to fix

                    File ext-lang-id.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*!
                     * Ext JS Library 3.2.1
                     * Copyright(c) 2006-2010 Ext JS, Inc.
                     * licensing@extjs.com
                     * http://www.extjs.com/license
                    Severity: Minor
                    Found in public/ext/locale/ext-lang-id.js - About 2 hrs to fix

                      Method save_physically has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def save_physically
                          return false if !valid?
                          is_new = new_record?
                      
                          if is_new
                      Severity: Major
                      Found in app/models/virtual_server.rb - About 2 hrs to fix

                        File ext-lang-it.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /*!
                         * Ext JS Library 3.2.1
                         * Copyright(c) 2006-2010 Ext JS, Inc.
                         * licensing@extjs.com
                         * http://www.extjs.com/license
                        Severity: Minor
                        Found in public/ext/locale/ext-lang-it.js - About 2 hrs to fix

                          File ext-lang-cs.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /*!
                           * Ext JS Library 3.2.1
                           * Copyright(c) 2006-2010 Ext JS, Inc.
                           * licensing@extjs.com
                           * http://www.extjs.com/license
                          Severity: Minor
                          Found in public/ext/locale/ext-lang-cs.js - About 2 hrs to fix

                            File ext-lang-th.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*!
                             * Ext JS Library 3.2.1
                             * Copyright(c) 2006-2010 Ext JS, Inc.
                             * licensing@extjs.com
                             * http://www.extjs.com/license
                            Severity: Minor
                            Found in public/ext/locale/ext-lang-th.js - About 2 hrs to fix

                              File ext-lang-da.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*!
                               * Ext JS Library 3.2.1
                               * Copyright(c) 2006-2010 Ext JS, Inc.
                               * licensing@extjs.com
                               * http://www.extjs.com/license
                              Severity: Minor
                              Found in public/ext/locale/ext-lang-da.js - About 2 hrs to fix

                                File ext-lang-no_NN.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /*!
                                 * Ext JS Library 3.2.1
                                 * Copyright(c) 2006-2010 Ext JS, Inc.
                                 * licensing@extjs.com
                                 * http://www.extjs.com/license
                                Severity: Minor
                                Found in public/ext/locale/ext-lang-no_NN.js - About 2 hrs to fix

                                  File ext-lang-he.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /*!
                                   * Ext JS Library 3.2.1
                                   * Copyright(c) 2006-2010 Ext JS, Inc.
                                   * licensing@extjs.com
                                   * http://www.extjs.com/license
                                  Severity: Minor
                                  Found in public/ext/locale/ext-lang-he.js - About 2 hrs to fix

                                    File ext-lang-no_NB.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    /*!
                                     * Ext JS Library 3.2.1
                                     * Copyright(c) 2006-2010 Ext JS, Inc.
                                     * licensing@extjs.com
                                     * http://www.extjs.com/license
                                    Severity: Minor
                                    Found in public/ext/locale/ext-lang-no_NB.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language