t3labcom/capistrano-typo3

View on GitHub

Showing 6 of 612 total issues

File typo3_helper.rb has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'open-uri'
require 'json'

class Typo3Helper

Severity: Minor
Found in lib/capistrano/typo3/typo3_helper.rb - About 4 hrs to fix

    Class Typo3Helper has 36 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Typo3Helper
    
      def self.typo3_version_list
    
        source = "https://get.typo3.org/json"
    Severity: Minor
    Found in lib/capistrano/typo3/typo3_helper.rb - About 4 hrs to fix

      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