t3labcom/capistrano-typo3

View on GitHub

Showing 29 of 612 total issues

Method has too many lines. [12/10]
Open

  def self.set_v4_typo3_conf_vars(confvars)
    text = File.read(TYPO3_V4_LOCAL_CONF_PATH)

    confvars.each do |mainKey, mainHash|
      mainHash.each do |key,var|

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for set_v6_localconf_extlist is too high. [17.52/15]
Open

  def self.set_v6_localconf_extlist(extList)

    outfile = File.join('current','dummy','typo3conf','PackageStates.php')
    confhash = self.get_v6_package_states
#    require 'pp'

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [12/10]
Open

  def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')
      cmd1 = "php -r \'define(\"TYPO3_MODE\", \"BE\");" \
        "$arr = include \"#{fetch(:typo3_v6_local_conf_path)}\"; " \
        "echo \"<?php\\n\";" \
        "echo \"return \";" \

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for set_v4_localconf_extlist is too high. [16.55/15]
Open

  def self.set_v4_localconf_extlist(extList)

    extList = Typo3Helper::get_v4_localconf_extlist('extList')
    extList_fe = Typo3Helper::get_v4_localconf_extlist('extList_FE')

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for typo3_version_list_for_table is too high. [16.64/15]
Open

  def self.typo3_version_list_for_table
    version_arr = []
    idx = 0
    versions_list_in = []
    versions = Typo3Helper::get_typo3_versions

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method set_v6_localconf_extlist has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.set_v6_localconf_extlist(extList)

    outfile = File.join('current','dummy','typo3conf','PackageStates.php')
    confhash = self.get_v6_package_states
#    require 'pp'
Severity: Minor
Found in lib/capistrano/typo3/typo3_helper.rb - About 1 hr to fix

    Method create_mysql_base_command_with has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.create_mysql_base_command_with(user,host,password,db,exec='mysql')
    Severity: Minor
    Found in lib/capistrano/typo3/dt3_mysql.rb - About 35 mins to fix

      Method db_image_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.db_image_list
          images_arr = []
          idx = 0
      
          Dir.glob("#{TYPO3_DB_DUMP_DIR}/*.sql").sort.each {|sql|
      Severity: Minor
      Found in lib/capistrano/typo3/dt3_mysql.rb - About 35 mins 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 download_typo3_source has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def self.download_typo3_source version
      
          tarball= "typo3source/typo3_src-#{version}.tar.gz"
      
          unless File.directory?('typo3source')
      Severity: Minor
      Found in lib/capistrano/typo3/typo3_helper.rb - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language