t3labcom/capistrano-typo3

View on GitHub
lib/capistrano/typo3/typo3_helper.rb

Summary

Maintainability
C
1 day
Test Coverage

Class has too many lines. [367/100]
Open

class Typo3Helper

  def self.typo3_version_list

    source = "https://get.typo3.org/json"

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

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 has too many lines. [35/10]
      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 if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

        def self.download_typo3_source version
      
          tarball= "typo3source/typo3_src-#{version}.tar.gz"
      
          unless File.directory?('typo3source')

      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.

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

        def self.get_extconfarray_from_localconf(infile)
          if(self.typo3_localconf_version == 6)
            confhash = self.get_v6_localconf_array
            extensionArr = Hash.new
            confhash['EXT']['extConf'].each {|extkey,extconf|

      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.

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

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

      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 download_typo3_source is too high. [21.56/15]
      Open

        def self.download_typo3_source version
      
          tarball= "typo3source/typo3_src-#{version}.tar.gz"
      
          unless File.directory?('typo3source')

      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. [15/10]
      Open

        def self.typo3_version_list
      
          source = "https://get.typo3.org/json"
          content = ""
          open(source) do |s|

      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.

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

        def self.set_v6_typo3_conf_vars(confvars)
      
          outfile = TYPO3_V6_LOCAL_CONF_PATH
      
          confhash = self.get_v6_localconf_array

      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 last_minor_version is too high. [18.14/15]
      Open

        def self.last_minor_version(versions, majorversion)
          list = []
          versions.each_line do |line|
            if(line[15,3]==majorversion)
              if(line.chomp[19,2].to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/))

      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.get_db_settings
          if(self.typo3_localconf_version == 6)
            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");$arr = include \"#{TYPO3_V6_LOCAL_CONF_PATH}\";echo \"{$arr[\"DB\"][\"username\"]} {$arr[\"DB\"][\"password\"]} {$arr[\"DB\"][\"host\"]} {$arr[\"DB\"][\"database\"]}\";\'"
          elsif(self.typo3_localconf_version == 4)
            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");include \"#{TYPO3_V4_LOCAL_CONF_PATH}\";echo \"$typo_db_username $typo_db_password $typo_db_host $typo_db\";\'"

      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.

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

        def self.get_localconf_extlist
          if(self.typo3_localconf_version == 6)
            confhash = self.get_v6_package_states
            activeList = []
            confhash['packages'].each do |extKey, extAttr|

      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.

      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.

      Method has too many lines. [12/10]
      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 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 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

      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

      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 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

        Use each_value instead of each.
        Open

            my_hash.each do |k,v|

        This cop checks for uses of each_key and each_value Hash methods.

        Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

        Example:

        # bad
        hash.keys.each { |k| p k }
        hash.values.each { |v| p v }
        hash.each { |k, _v| p k }
        hash.each { |_k, v| p v }
        
        # good
        hash.each_key { |k| p k }
        hash.each_value { |v| p v }

        Use each_key instead of each.
        Open

                v['releases'].each do |rel,relprops|

        This cop checks for uses of each_key and each_value Hash methods.

        Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

        Example:

        # bad
        hash.keys.each { |k| p k }
        hash.values.each { |v| p v }
        hash.each { |k, _v| p k }
        hash.each { |_k, v| p v }
        
        # good
        hash.each_key { |k| p k }
        hash.each_value { |v| p v }

        Extra empty line detected at method body beginning.
        Open

        
            outfile = File.join('current','dummy','typo3conf','PackageStates.php')

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space missing after comma.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            outfile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            outfile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            system("ln -sf ../../../typo3source/typo3_src-#{version} #{File.join('current','dummy','typo3_src')}")

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Surrounding space missing in default value assignment.
        Open

          def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')

        Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.

        Example:

        # bad
        def some_method(arg1=:default, arg2=nil, arg3=[])
          # do something...
        end
        
        # good
        def some_method(arg1 = :default, arg2 = nil, arg3 = [])
          # do something...
        end

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator =.
        Open

            _version_arr= []

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

            newconf= "$TYPO3_CONF_VARS['EXT']['extList'] = '#{extList.join(',')}'"

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

              ret =%x[ #{cmd} ]

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
        Open

              cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{infile}\";echo serialize($TYPO3_CONF_VARS[\"EXT\"][\"extConf\"]);\'"

        This cop checks for assignments in the conditions of if/while/until.

        Example:

        # bad
        
        if some_var = true
          do_something
        end

        Example:

        # good
        
        if some_var == true
          do_something
        end

        Unused block argument - relprops. If it's necessary, use _ or _relprops as an argument name to indicate that it won't be used.
        Open

                v['releases'].each do |rel,relprops|

        This cop checks for unused block arguments.

        Example:

        # bad
        
        do_something do |used, unused|
          puts used
        end
        
        do_something do |bar|
          puts :foo
        end
        
        define_method(:foo) do |bar|
          puts :baz
        end

        Example:

        #good
        
        do_something do |used, _unused|
          puts used
        end
        
        do_something do
          puts :foo
        end
        
        define_method(:foo) do |_bar|
          puts :baz
        end

        Line is too long. [111/80]
        Open

            text = text.gsub(/^\$TYPO3_CONF_VARS\['EXT'\]\['extList_FE'\].*/, newconf_FE+"; #{TYPO3_MODIFY_SIGNATURE}")

        Line is too long. [131/80]
        Open

            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");echo \"<?php\\n\";echo \"return \";$contents = file_get_contents(\"./tmpjson\");

        Line is too long. [106/80]
        Open

            system("ln -sf ../../../typo3source/typo3_src-#{version} #{File.join('current','dummy','typo3_src')}")

        Line is too long. [93/80]
        Open

            #system("cd current/dummy && ln -sf ../../../typo3source/typo3_src-#{version} typo3_src")

        Use 2 (not 4) spaces for indentation.
        Open

              cmd1 = "php -r \'define(\"TYPO3_MODE\", \"BE\");" \

        This cops checks for indentation that doesn't use the specified number of spaces.

        See also the IndentationConsistency cop which is the companion to this one.

        Example:

        # bad
        class A
         def test
          puts 'hello'
         end
        end
        
        # good
        class A
          def test
            puts 'hello'
          end
        end

        Example: IgnoredPatterns: ['^\s*module']

        # bad
        module A
        class B
          def test
          puts 'hello'
          end
        end
        end
        
        # good
        module A
        class B
          def test
            puts 'hello'
          end
        end
        end

        Use 2 (not 3) spaces for indentation.
        Open

                 if extAttr['state']=='active'

        This cops checks for indentation that doesn't use the specified number of spaces.

        See also the IndentationConsistency cop which is the companion to this one.

        Example:

        # bad
        class A
         def test
          puts 'hello'
         end
        end
        
        # good
        class A
          def test
            puts 'hello'
          end
        end

        Example: IgnoredPatterns: ['^\s*module']

        # bad
        module A
        class B
          def test
          puts 'hello'
          end
        end
        end
        
        # good
        module A
        class B
          def test
            puts 'hello'
          end
        end
        end

        Missing space after #.
        Open

          #truncates a list of tables

        This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

        Example:

        # bad
        #Some comment
        
        # good
        # Some comment

        Space missing after comma.
        Open

            my_hash.each do |k,v|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

                v['releases'].each do |rel,relprops|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'8.1')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','localconf.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Do not use spaces inside percent literal delimiters.
        Open

              extList =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Line is too long. [164/80]
        Open

              cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");include \"#{TYPO3_V4_LOCAL_CONF_PATH}\";echo \"$typo_db_username $typo_db_password $typo_db_host $typo_db\";\'"

        Line is too long. [99/80]
        Open

                text = text.gsub(/^\$TYPO3_CONF_VARS\['EXT'\]\['extConf'\]\['#{key}'\].*/, typo3_conf_vars)

        Line is too long. [90/80]
        Open

                  text = text.gsub(/^\$TYPO3_CONF_VARS\['#{mainKey}'\]\['#{key}'\].*/, confstring)

        Line is too long. [198/80]
        Open

            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");echo \"<?php\\n\";echo \"return \";$contents = file_get_contents(\"./tmpjson\"); $arr = json_decode($contents);var_export($arr);echo \";\\n?>\";\'"

        Incorrect indentation detected (column 0 instead of 4).
        Open

        #    PP.pp confhash

        This cops checks the indentation of comments.

        Example:

        # bad
          # comment here
        def method_name
        end
        
          # comment here
        a = 'hello'
        
        # yet another comment
          if true
            true
          end
        
        # good
        # comment here
        def method_name
        end
        
        # comment here
        a = 'hello'
        
        # yet another comment
        if true
          true
        end

        Extra empty line detected at method body end.
        Open

        
          end

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space missing after comma.
        Open

          def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

              _extArray.each {|extkey,extconf|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Surrounding space missing in default value assignment.
        Open

          def self.typo3_last_version(version=nil)

        Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.

        Example:

        # bad
        def some_method(arg1=:default, arg2=nil, arg3=[])
          # do something...
        end
        
        # good
        def some_method(arg1 = :default, arg2 = nil, arg3 = [])
          # do something...
        end

        Space after keyword elsif is missing.
        Open

            elsif(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator +.
        Open

              return_string << "TYPO3 version: "+ v+ "\n"

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator +.
        Open

              return_string << "TYPO3 version: "+ v+ "\n"

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

            dbsettings =%x[ #{cmd} ].split(' ')

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

              _extArray= PHP.unserialize(ret)

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Do not use spaces inside percent literal delimiters.
        Open

            dbsettings =%x[ #{cmd} ].split(' ')

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Do not use spaces inside percent literal delimiters.
        Open

              extList =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Line is too long. [107/80]
        Open

            system('gunzip -c current/dummy/typo3temp/extensions.xml.gz > current/dummy/typo3temp/extensions.xml');

        Extra empty line detected at block body end.
        Open

        
            end

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Extra empty line detected at method body beginning.
        Open

        
            source = "https://get.typo3.org/json"

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Extra empty line detected at method body end.
        Open

        
          end

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','localconf.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            DT3Div.downloadTo('typo3.org','/fileadmin/ter/extensions.xml.gz','current/dummy/typo3temp/extensions.xml.gz')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator +.
        Open

            return majorversion+"."+list.sort.reverse[0].to_i.to_s

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Do not use spaces inside percent literal delimiters.
        Open

            dbsettings =%x[ #{cmd} ].split(' ')

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        (...) interpreted as grouped expression.
        Open

            system (cmd)

        Checks for space between the name of a called method and a left parenthesis.

        Example:

        # bad
        
        puts (x + y)

        Example:

        # good
        
        puts(x + y)

        Argument extList was shadowed by a local variable before it was used.
        Open

            extList = Typo3Helper::get_v4_localconf_extlist('extList')

        This cop checks for shadowed arguments.

        Example:

        # bad
        
        do_something do |foo|
          foo = 42
          puts foo
        end
        
        def do_something(foo)
          foo = 42
          puts foo
        end

        Example:

        # good
        
        do_something do |foo|
          foo = foo + 42
          puts foo
        end
        
        def do_something(foo)
          foo = foo + 42
          puts foo
        end
        
        def do_something(foo)
          puts foo
        end

        Line is too long. [84/80]
        Open

                confVars['EXT']['extConf'][key] = "#{PHP.serialize(arr).gsub("'", "\\\\'")}"

        Extra empty line detected at block body beginning.
        Open

        
              if(v['releases'])

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Space missing after comma.
        Open

              FileUtils.rm_r(File.join('typo3source',"typo3_src-#{version}"))

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

          def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

            if(CONFIG['PHPEXEC'])

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword if is missing.
        Open

              if(CONFIG['TYPO3_ALTERNATIVE_SOURCE_URL'])

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword elsif is missing.
        Open

            elsif(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator -.
        Open

                srcurl = altsrc[7..(altsrc.index('/',8)-1)]

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Do not prefix writer method names with set_.
        Open

          def self.set_v4_typo3_conf_vars(confvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not prefix writer method names with set_.
        Open

          def self.set_v6_typo3_conf_vars(confvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use a guard clause instead of wrapping the code inside a conditional expression.
        Open

            if self.typo3_localconf_version == 4

        Use a guard clause instead of wrapping the code inside a conditional expression

        Example:

        # bad
        def test
          if something
            work
          end
        end
        
        # good
        def test
          return unless something
          work
        end
        
        # also good
        def test
          work if something
        end
        
        # bad
        if something
          raise 'exception'
        else
          ok
        end
        
        # good
        raise 'exception' if something
        ok

        Redundant return detected.
        Open

            return version_arr

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return true

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return activeList

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            elsif(self.typo3_localconf_version == 4)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at block body beginning.
        Open

        
                confstring = "$TYPO3_CONF_VARS['#{mainKey}']['#{key}'] = '#{var}'; #{TYPO3_MODIFY_SIGNATURE}"

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Extra empty line detected at method body beginning.
        Open

        
            all_current_tables = capture DT3MySQL::show_tables.split("\n")

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space missing after comma.
        Open

            system("rm -f #{File.join('current','dummy','typo3_src')}")

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword elsif is missing.
        Open

            elsif(self.typo3_localconf_version == 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator +.
        Open

                version = altsrc[altsrc.index('typo3_src-')+10,6]

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

            cache_tables= %w(cache_extensions cache_hash cache_imagesizes cache_md5params cache_pages cache_pagesection cache_sys_dmail_stat cache_treelist cache_typo3temp_log cachingframework_cache_hash cachingframework_cache_hash_tags cachingframework_cache_pages cachingframework_cache_pages_tags cachingframework_cache_pagesection cachingframework_cache_pagesection_tags cf_cache_hash cf_cache_hash_tags cf_cache_pages cf_cache_pages_tags cf_cache_pagesection cf_cache_pagesection_tags cf_extbase_object cf_extbase_object_tags cf_extbase_reflection cf_extbase_reflection_tags cf_tt_news_cache cf_tt_news_cache_tags cf_tx_solr cf_tx_solr_tags tt_news_cache tt_news_cache_tags tx_realurl_chashcache tx_realurl_errorlog tx_realurl_pathcache tx_realurl_uniqalias tx_realurl_urldecodecache tx_realurl_urlencodecache tx_solr_cache tx_solr_cache_tags)

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

            ret =%x[ #{cmd} ]

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Space missing after comma.
        Open

              typo3_version = Typo3Helper::last_minor_version(versions,version.to_s)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space between { and | missing.
        Open

            versions_list_in.each {|version_in|

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Space missing after comma.
        Open

            extconfvars.each do |key,arr|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space between { and | missing.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Space missing after comma.
        Open

              extconfvars.each do |key,arr|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Do not use prefix _ for a variable that is used.
        Open

            _version_arr= []

        This cop checks for underscore-prefixed variables that are actually used.

        Example:

        # bad
        
        [1, 2, 3].each do |_num|
          do_something(_num)
        end

        Example:

        # good
        
        [1, 2, 3].each do |num|
          do_something(num)
        end

        Example:

        # good
        
        [1, 2, 3].each do |_num|
          do_something # not using `_num`
        end

        Space missing after comma.
        Open

            system("ln -sf ../../../typo3source/typo3_src-#{version} #{File.join('current','dummy','typo3_src')}")

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Do not use :: for method calls.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'6.2')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Space missing after comma.
        Open

            DT3Div.downloadTo('typo3.org','/fileadmin/ter/extensions.xml.gz','current/dummy/typo3temp/extensions.xml.gz')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Do not use :: for method calls.
        Open

              typo3_version = Typo3Helper::last_minor_version(versions,version.to_s)

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Use the return of the conditional for variable assignment and comparison.
        Open

                if text.include?("$TYPO3_CONF_VARS['#{mainKey}']['#{key}']")
                  text = text.gsub(/^\$TYPO3_CONF_VARS\['#{mainKey}'\]\['#{key}'\].*/, confstring)
                else
                  text = text.gsub(/^\?>/, confstring + "\n?>")
                end

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Use a guard clause instead of wrapping the code inside a conditional expression.
        Open

            if(CONFIG['PHPEXEC'])

        Use a guard clause instead of wrapping the code inside a conditional expression

        Example:

        # bad
        def test
          if something
            work
          end
        end
        
        # good
        def test
          return unless something
          work
        end
        
        # also good
        def test
          work if something
        end
        
        # bad
        if something
          raise 'exception'
        else
          ok
        end
        
        # good
        raise 'exception' if something
        ok

        Space after keyword elsif is missing.
        Open

            elsif(self.typo3_localconf_version == 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
        Open

                 if extAttr['state']=='active'

        Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

        Example:

        # bad
        if condition
          do_stuff(bar)
        end
        
        unless qux.empty?
          Foo.do_something
        end
        
        # good
        do_stuff(bar) if condition
        Foo.do_something unless qux.empty?

        Use def with parentheses when there are parameters.
        Open

          def self.symlink_source version

        This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

        Example: EnforcedStyle: require_parentheses (default)

        # The `require_parentheses` style requires method definitions
        # to always use parentheses
        
        # bad
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Example: EnforcedStyle: requirenoparentheses

        # The `require_no_parentheses` style requires method definitions
        # to never use parentheses
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end

        Example: EnforcedStyle: requirenoparenthesesexceptmultiline

        # The `require_no_parentheses_except_multiline` style prefers no
        # parantheses when method definition arguments fit on single line,
        # but prefers parantheses when arguments span multiple lines.
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Use next to skip iteration.
        Open

              if(v['releases'])

        Use next to skip iteration instead of a condition at the end.

        Example: EnforcedStyle: skipmodifierifs (default)

        # bad
        [1, 2].each do |a|
          if a == 1
            puts a
          end
        end
        
        # good
        [1, 2].each do |a|
          next unless a == 1
          puts a
        end
        
        # good
        [1, 2].each do |o|
          puts o unless o == 1
        end

        Example: EnforcedStyle: always

        # With `always` all conditions at the end of an iteration needs to be
        # replaced by next - with `skip_modifier_ifs` the modifier if like
        # this one are ignored: `[1, 2].each { |a| return 'yes' if a == 1 }`
        
        # bad
        [1, 2].each do |o|
          puts o unless o == 1
        end
        
        # bad
        [1, 2].each do |a|
          if a == 1
            puts a
          end
        end
        
        # good
        [1, 2].each do |a|
          next unless a == 1
          puts a
        end

        Surrounding space missing for operator =.
        Open

                extAttr['state']='inactive'

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Redundant return detected.
        Open

            return  _version_arr.uniq.sort

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return CONFIG['PHPEXEC']

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Space missing inside }.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Redundant return detected.
        Open

              return extList.split(',');

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        (...) interpreted as grouped expression.
        Open

            system (cmd)

        Checks for space between the name of a called method and a left parenthesis.

        Example:

        # bad
        
        puts (x + y)

        Example:

        # good
        
        puts(x + y)

        Redundant self detected.
        Open

            self.truncate_tables(cache_tables)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Line is too long. [89/80]
        Open

          # Get last minor version bases on configuration or argument, e.g 6.2 returns ATOW 6.2.9

        Line is too long. [83/80]
        Open

            newconf_FE= "$TYPO3_CONF_VARS['EXT']['extList_FE'] = '#{extList_fe.join(',')}'"

        Line is too long. [105/80]
        Open

            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");$arr = include \"#{infile}\";echo json_encode($arr);'"

        Do not prefix reader method names with get_.
        Open

          def self.get_typo3_versions

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not prefix reader method names with get_.
        Open

          def self.get_localconf_extlist

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

              confVars = {}

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Do not use :: for method calls.
        Open

            versions = Typo3Helper::get_typo3_versions

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        %w-literals should be delimited by [ and ].
        Open

            session_tables=%w(be_sessions fe_session_data fe_sessions)

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        %x-literals should be delimited by ( and ).
        Open

            ret =%x[ #{cmd} ]

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        %x-literals should be delimited by ( and ).
        Open

              extList =%x[ #{cmd} ]

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        Redundant return detected.
        Open

              return 4

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return PHP.unserialize(ret)

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

                self.set_v6_typo3_conf_vars(confvars)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

                self.set_v4_typo3_conf_vars(confvars)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 4)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Space missing after comma.
        Open

                srcpath = altsrc[(altsrc.index('/',8))..-1]

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

              confhash['EXT']['extConf'].each {|extkey,extconf|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Surrounding space missing for operator ==.
        Open

              if(line[15,3]==majorversion)

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator +.
        Open

            text = text.gsub(/^\$TYPO3_CONF_VARS\['EXT'\]\['extList'\].*/, newconf+"; #{TYPO3_MODIFY_SIGNATURE}")

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator =.
        Open

              extList =%x[ #{cmd} ]

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Space between { and | missing.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Use snake_case for variable names.
        Open

              confhash['packages'].each do |extKey, extAttr|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

              extList =%x[ #{cmd} ]

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Avoid using {...} for multi-line blocks.
        Open

            versions_list_in.each {|version_in|

        Check for uses of braces or do/end around single line or multi-line blocks.

        Example: EnforcedStyle: linecountbased (default)

        # bad - single line block
        items.each do |item| item / 5 end
        
        # good - single line block
        items.each { |item| item / 5 }
        
        # bad - multi-line block
        things.map { |thing|
          something = thing.some_method
          process(something)
        }
        
        # good - multi-line block
        things.map do |thing|
          something = thing.some_method
          process(something)
        end

        Example: EnforcedStyle: semantic

        # Prefer `do...end` over `{...}` for procedural blocks.
        
        # return value is used/assigned
        # bad
        foo = map do |x|
          x
        end
        puts (map do |x|
          x
        end)
        
        # return value is not used out of scope
        # good
        map do |x|
          x
        end
        
        # Prefer `{...}` over `do...end` for functional blocks.
        
        # return value is not used out of scope
        # bad
        each { |x|
          x
        }
        
        # return value is used/assigned
        # good
        foo = map { |x|
          x
        }
        map { |x|
          x
        }.inspect

        Example: EnforcedStyle: bracesforchaining

        # bad
        words.each do |word|
          word.flip.flop
        end.join("-")
        
        # good
        words.each { |word|
          word.flip.flop
        }.join("-")

        Do not use :: for method calls.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Do not use :: for method calls.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Use backticks around command string.
        Open

            dbsettings =%x[ #{cmd} ].split(' ')

        This cop enforces using `` or %x around command literals.

        Example: EnforcedStyle: backticks (default)

        # bad
        folders = %x(find . -type d).split
        
        # bad
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )
        
        # good
        folders = `find . -type d`.split
        
        # good
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `

        Example: EnforcedStyle: mixed

        # bad
        folders = %x(find . -type d).split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = `find . -type d`.split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: EnforcedStyle: percent_x

        # bad
        folders = `find . -type d`.split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = %x(find . -type d).split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: AllowInnerBackticks: false (default)

        # If `false`, the cop will always recommend using `%x` if one or more
        # backticks are found in the command string.
        
        # bad
        `echo \`ls\``
        
        # good
        %x(echo `ls`)

        Example: AllowInnerBackticks: true

        # good
        `echo \`ls\``

        Move DT3Div::downloadTo(srcurl,srcpath,tarball) out of the conditional.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        This cop checks for identical lines at the beginning or end of each branch of a conditional statement.

        Example:

        # bad
        if condition
          do_x
          do_z
        else
          do_y
          do_z
        end
        
        # good
        if condition
          do_x
        else
          do_y
        end
        do_z
        
        # bad
        if condition
          do_z
          do_x
        else
          do_z
          do_y
        end
        
        # good
        do_z
        if condition
          do_x
        else
          do_y
        end
        
        # bad
        case foo
        when 1
          do_x
        when 2
          do_x
        else
          do_x
        end
        
        # good
        case foo
        when 1
          do_x
          do_y
        when 2
          # nothing
        else
          do_x
          do_z
        end

        Redundant return detected.
        Open

            return version_m[2]

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return "#{version_m[0]}.#{version_m[1]}"

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return JSON.parse(json)

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return extensionArr

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            version_arr = self.typo3_version_list

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            elsif(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at block body beginning.
        Open

        
              typo3_conf_vars = "$TYPO3_CONF_VARS['EXT']['extConf']['#{key}'] = '#{PHP.serialize(arr).gsub("'", "\\\\'")}'; #{TYPO3_MODIFY_SIGNATURE}"

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Space missing after comma.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            newphpconf.gsub!('stdClass::__set_state(','')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Surrounding space missing in default value assignment.
        Open

          def self.get_v4_localconf_extlist(extlistKey='extList')

        Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.

        Example:

        # bad
        def some_method(arg1=:default, arg2=nil, arg3=[])
          # do something...
        end
        
        # good
        def some_method(arg1 = :default, arg2 = nil, arg3 = [])
          # do something...
        end

        Space after keyword if is missing.
        Open

              if(line[15,3]==majorversion)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator +.
        Open

            return majorversion+"."+list.sort.reverse[0].to_i.to_s

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Line is too long. [840/80]
        Open

            cache_tables= %w(cache_extensions cache_hash cache_imagesizes cache_md5params cache_pages cache_pagesection cache_sys_dmail_stat cache_treelist cache_typo3temp_log cachingframework_cache_hash cachingframework_cache_hash_tags cachingframework_cache_pages cachingframework_cache_pages_tags cachingframework_cache_pagesection cachingframework_cache_pagesection_tags cf_cache_hash cf_cache_hash_tags cf_cache_pages cf_cache_pages_tags cf_cache_pagesection cf_cache_pagesection_tags cf_extbase_object cf_extbase_object_tags cf_extbase_reflection cf_extbase_reflection_tags cf_tt_news_cache cf_tt_news_cache_tags cf_tx_solr cf_tx_solr_tags tt_news_cache tt_news_cache_tags tx_realurl_chashcache tx_realurl_errorlog tx_realurl_pathcache tx_realurl_uniqalias tx_realurl_urldecodecache tx_realurl_urlencodecache tx_solr_cache tx_solr_cache_tags)

        Do not prefix writer method names with set_.
        Open

          def self.set_v6_localconf_extlist(extList)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

            confvars.each do |mainKey, mainHash|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

          def self.set_localconf_extlist(extList)

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

          def self.set_v4_localconf_extlist(extList)

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

            extList = Typo3Helper::get_v4_localconf_extlist('extList')

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Do not use :: for method calls.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'7.0')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Use the return of the conditional for variable assignment and comparison.
        Open

              if extList.include? extKey
                extAttr['state']='active'
              else
                extAttr['state']='inactive'
              end

        Use hash literal {} instead of Hash.new.
        Open

              extensionArr = Hash.new

        This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

        Example:

        # bad
        a = Array.new
        h = Hash.new
        s = String.new
        
        # good
        a = []
        h = {}
        s = ''

        Move DT3Div::downloadTo(srcurl,srcpath,tarball) out of the conditional.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        This cop checks for identical lines at the beginning or end of each branch of a conditional statement.

        Example:

        # bad
        if condition
          do_x
          do_z
        else
          do_y
          do_z
        end
        
        # good
        if condition
          do_x
        else
          do_y
        end
        do_z
        
        # bad
        if condition
          do_z
          do_x
        else
          do_z
          do_y
        end
        
        # good
        do_z
        if condition
          do_x
        else
          do_y
        end
        
        # bad
        case foo
        when 1
          do_x
        when 2
          do_x
        else
          do_x
        end
        
        # good
        case foo
        when 1
          do_x
          do_y
        when 2
          # nothing
        else
          do_x
          do_z
        end

        Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
        Open

            if version.nil?

        Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

        Example:

        # bad
        if condition
          do_stuff(bar)
        end
        
        unless qux.empty?
          Foo.do_something
        end
        
        # good
        do_stuff(bar) if condition
        Foo.do_something unless qux.empty?

        Redundant return detected.
        Open

              return set_v4_typo3_extconf_settings extconfvars

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            elsif(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at method body beginning.
        Open

        
            if version.nil?

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Missing space after #.
        Open

          #unused at the moment, could be handy

        This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

        Example:

        # bad
        #Some comment
        
        # good
        # Some comment

        Space missing after comma.
        Open

                srcurl = altsrc[7..(altsrc.index('/',8)-1)]

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

              if(line[15,3]==majorversion)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

              mainHash.each do |key,var|

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            newphpconf.gsub!('))',')')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

            if(confvars)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword if is missing.
        Open

            if(CONFIG['TYPO3_MAIN_VERSION'].to_s.split('.')[0].to_i > 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword if is missing.
        Open

            if(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator =.
        Open

            newconf_FE= "$TYPO3_CONF_VARS['EXT']['extList_FE'] = '#{extList_fe.join(',')}'"

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Surrounding space missing for operator +.
        Open

            text = text.gsub(/^\$TYPO3_CONF_VARS\['EXT'\]\['extList_FE'\].*/, newconf_FE+"; #{TYPO3_MODIFY_SIGNATURE}")

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        (...) interpreted as grouped expression.
        Open

            system (cmd)

        Checks for space between the name of a called method and a left parenthesis.

        Example:

        # bad
        
        puts (x + y)

        Example:

        # good
        
        puts(x + y)

        Line is too long. [142/80]
        Open

              typo3_conf_vars = "$TYPO3_CONF_VARS['EXT']['extConf']['#{key}'] = '#{PHP.serialize(arr).gsub("'", "\\\\'")}'; #{TYPO3_MODIFY_SIGNATURE}"

        Line is too long. [101/80]
        Open

                confstring = "$TYPO3_CONF_VARS['#{mainKey}']['#{key}'] = '#{var}'; #{TYPO3_MODIFY_SIGNATURE}"

        Line is too long. [133/80]
        Open

              cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{infile}\";echo serialize($TYPO3_CONF_VARS[\"EXT\"][\"extConf\"]);\'"

        Do not prefix writer method names with set_.
        Open

          def self.set_typo3_extconf_settings(extconfvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

            confhash['packages'].each do |extKey, extAttr|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

            confhash['packages'].each do |extKey, extAttr|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

          def self.get_v4_localconf_extlist(extlistKey='extList')

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Do not use :: for method calls.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'7.6')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Do not use :: for method calls.
        Open

                execute DT3MySQL::truncate_table(table)

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Omit the parentheses in defs when the method doesn't accept any arguments.
        Open

          def self.flush_config_cache()

        This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

        Example:

        # bad
        def foo()
          # does a thing
        end
        
        # good
        def foo
          # does a thing
        end
        
        # also good
        def foo() does_a_thing end

        Example:

        # bad
        def Baz.foo()
          # does a thing
        end
        
        # good
        def Baz.foo
          # does a thing
        end

        %x-literals should be delimited by ( and ).
        Open

              ret =%x[ #{cmd} ]

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        Don't use parentheses around a variable.
        Open

            system (cmd)

        This cop checks for redundant parentheses.

        Example:

        # bad
        (x) if ((y.z).nil?)
        
        # good
        x if y.z.nil?

        Redundant return detected.
        Open

              return set_v6_typo3_extconf_settings extconfvars

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

              self.set_v6_typo3_conf_vars confVars

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at class body beginning.
        Open

        
          def self.typo3_version_list

        This cops checks if empty lines around the bodies of classes match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        class Foo
        
          def bar
            # ...
          end
        
        end

        Example: EnforcedStyle: emptylinesexcept_namespace

        # good
        
        class Foo
          class Bar
        
            # ...
        
          end
        end

        Example: EnforcedStyle: emptylinesspecial

        # good
        class Foo
        
          def bar; end
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        class Foo
          def bar
            # ...
          end
        end

        Extra empty line detected at class body end.
        Open

        
        end

        This cops checks if empty lines around the bodies of classes match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        class Foo
        
          def bar
            # ...
          end
        
        end

        Example: EnforcedStyle: emptylinesexcept_namespace

        # good
        
        class Foo
          class Bar
        
            # ...
        
          end
        end

        Example: EnforcedStyle: emptylinesspecial

        # good
        class Foo
        
          def bar; end
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        class Foo
          def bar
            # ...
          end
        end

        Extra empty line detected at method body beginning.
        Open

        
            tarball= "typo3source/typo3_src-#{version}.tar.gz"

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Extra empty line detected at method body beginning.
        Open

        
            extList = Typo3Helper::get_v4_localconf_extlist('extList')

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space between { and | missing.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Line is too long. [224/80]
        Open

              cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");$arr = include \"#{TYPO3_V6_LOCAL_CONF_PATH}\";echo \"{$arr[\"DB\"][\"username\"]} {$arr[\"DB\"][\"password\"]} {$arr[\"DB\"][\"host\"]} {$arr[\"DB\"][\"database\"]}\";\'"

        Line is too long. [123/80]
        Open

            cmd = "php -r \'define(\"TYPO3_MODE\", \"BE\");$arr = include \"#{TYPO3_V6_LOCAL_CONF_PATH}\";echo json_encode($arr);'"

        Do not prefix writer method names with set_.
        Open

          def self.set_v4_typo3_extconf_settings(extconfvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

          def self.set_v6_localconf_extlist(extList)

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Do not use :: for method calls.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'8.1')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Use a guard clause instead of wrapping the code inside a conditional expression.
        Open

            if(self.typo3_localconf_version == 4)

        Use a guard clause instead of wrapping the code inside a conditional expression

        Example:

        # bad
        def test
          if something
            work
          end
        end
        
        # good
        def test
          return unless something
          work
        end
        
        # also good
        def test
          work if something
        end
        
        # bad
        if something
          raise 'exception'
        else
          ok
        end
        
        # good
        raise 'exception' if something
        ok

        Redundant return detected.
        Open

            return dbsetarr

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            confhash = self.get_v6_package_states

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Use 2 (not 4) spaces for indentation.
        Open

              confVars = {}

        This cops checks for indentation that doesn't use the specified number of spaces.

        See also the IndentationConsistency cop which is the companion to this one.

        Example:

        # bad
        class A
         def test
          puts 'hello'
         end
        end
        
        # good
        class A
          def test
            puts 'hello'
          end
        end

        Example: IgnoredPatterns: ['^\s*module']

        # bad
        module A
        class B
          def test
          puts 'hello'
          end
        end
        end
        
        # good
        module A
        class B
          def test
            puts 'hello'
          end
        end
        end

        Space missing after comma.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'7.0')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

                  list << sprintf('%02d',line.chomp[19,2])

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

                  list << sprintf('%02d',line.chomp[19,2])

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            newphpconf.gsub!('stdClass::__set_state(','')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            outfile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword elsif is missing.
        Open

            elsif(self.typo3_localconf_version == '4')

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Do not use spaces inside percent literal delimiters.
        Open

              ret =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Line is too long. [109/80]
        Open

            cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{infile}\";echo serialize($TYPO3_CONF_VARS);\'"

        Do not prefix reader method names with get_.
        Open

          def self.get_v6_package_states

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Avoid using {...} for multi-line blocks.
        Open

              _extArray.each {|extkey,extconf|

        Check for uses of braces or do/end around single line or multi-line blocks.

        Example: EnforcedStyle: linecountbased (default)

        # bad - single line block
        items.each do |item| item / 5 end
        
        # good - single line block
        items.each { |item| item / 5 }
        
        # bad - multi-line block
        things.map { |thing|
          something = thing.some_method
          process(something)
        }
        
        # good - multi-line block
        things.map do |thing|
          something = thing.some_method
          process(something)
        end

        Example: EnforcedStyle: semantic

        # Prefer `do...end` over `{...}` for procedural blocks.
        
        # return value is used/assigned
        # bad
        foo = map do |x|
          x
        end
        puts (map do |x|
          x
        end)
        
        # return value is not used out of scope
        # good
        map do |x|
          x
        end
        
        # Prefer `{...}` over `do...end` for functional blocks.
        
        # return value is not used out of scope
        # bad
        each { |x|
          x
        }
        
        # return value is used/assigned
        # good
        foo = map { |x|
          x
        }
        map { |x|
          x
        }.inspect

        Example: EnforcedStyle: bracesforchaining

        # bad
        words.each do |word|
          word.flip.flop
        end.join("-")
        
        # good
        words.each { |word|
          word.flip.flop
        }.join("-")

        Use next to skip iteration.
        Open

              if(line[15,3]==majorversion)

        Use next to skip iteration instead of a condition at the end.

        Example: EnforcedStyle: skipmodifierifs (default)

        # bad
        [1, 2].each do |a|
          if a == 1
            puts a
          end
        end
        
        # good
        [1, 2].each do |a|
          next unless a == 1
          puts a
        end
        
        # good
        [1, 2].each do |o|
          puts o unless o == 1
        end

        Example: EnforcedStyle: always

        # With `always` all conditions at the end of an iteration needs to be
        # replaced by next - with `skip_modifier_ifs` the modifier if like
        # this one are ignored: `[1, 2].each { |a| return 'yes' if a == 1 }`
        
        # bad
        [1, 2].each do |o|
          puts o unless o == 1
        end
        
        # bad
        [1, 2].each do |a|
          if a == 1
            puts a
          end
        end
        
        # good
        [1, 2].each do |a|
          next unless a == 1
          puts a
        end

        Redundant return detected.
        Open

              return extensionArr

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

              if(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

              self.set_v4_localconf_extlist(extList)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            elsif self.typo3_localconf_version == 6

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at block body end.
        Open

        
              }

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Space missing after comma.
        Open

                if(line.chomp[19,2].to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/))

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','PackageStates.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

              if(v['releases'])

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword if is missing.
        Open

                if(line.chomp[19,2].to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/))

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator =.
        Open

            tarball= "typo3source/typo3_src-#{version}.tar.gz"

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Space between { and | missing.
        Open

              _extArray.each {|extkey,extconf|

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Do not use spaces inside percent literal delimiters.
        Open

              ret =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Do not prefix reader method names with get_.
        Open

          def self.get_v6_localconf_array

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

            confvars.each do |mainKey, mainHash|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use backticks around command string.
        Open

              extList =%x[ #{cmd} ]

        This cop enforces using `` or %x around command literals.

        Example: EnforcedStyle: backticks (default)

        # bad
        folders = %x(find . -type d).split
        
        # bad
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )
        
        # good
        folders = `find . -type d`.split
        
        # good
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `

        Example: EnforcedStyle: mixed

        # bad
        folders = %x(find . -type d).split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = `find . -type d`.split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: EnforcedStyle: percent_x

        # bad
        folders = `find . -type d`.split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = %x(find . -type d).split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: AllowInnerBackticks: false (default)

        # If `false`, the cop will always recommend using `%x` if one or more
        # backticks are found in the command string.
        
        # bad
        `echo \`ls\``
        
        # good
        %x(echo `ls`)

        Example: AllowInnerBackticks: true

        # good
        `echo \`ls\``

        Don't use parentheses around a variable.
        Open

            system (cmd)

        This cop checks for redundant parentheses.

        Example:

        # bad
        (x) if ((y.z).nil?)
        
        # good
        x if y.z.nil?

        Redundant return detected.
        Open

              return get_v4_localconf_extlist('extList')

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return self.get_v6_localconf_array

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            confhash = self.get_v6_localconf_array

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

              confhash = self.get_v6_package_states

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

              return self.get_v6_localconf_array

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at method body beginning.
        Open

        
            session_tables=%w(be_sessions fe_session_data fe_sessions)

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Extra empty line detected at method body end.
        Open

        
          end

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Unnecessary spacing detected.
        Open

            return  _version_arr.uniq.sort

        This cop checks for extra/unnecessary whitespace.

        Example:

        # good if AllowForAlignment is true
        name      = "RuboCop"
        # Some comment and an empty line
        
        website  += "/bbatsov/rubocop" unless cond
        puts        "rubocop"          if     debug
        
        # bad for any configuration
        set_app("RuboCop")
        website  = "https://github.com/bbatsov/rubocop"

        Space missing after comma.
        Open

                version = altsrc[altsrc.index('typo3_src-')+10,6]

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

          def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            newphpconf.gsub!('))',')')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Extra empty line detected at block body end.
        Open

        
            end

        This cops checks if empty lines around the bodies of blocks match the configuration.

        Example: EnforcedStyle: empty_lines

        # good
        
        foo do |bar|
        
          # ...
        
        end

        Example: EnforcedStyle: noemptylines (default)

        # good
        
        foo do |bar|
          # ...
        end

        Space missing after comma.
        Open

            infile = File.join('current','dummy','typo3conf','localconf.php')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Use 2 (not 4) spaces for indentation.
        Open

              cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{TYPO3_V4_LOCAL_CONF_PATH}\";echo $TYPO3_CONF_VARS[\"EXT\"][\"#{extlistKey}\"];\'"

        This cops checks for indentation that doesn't use the specified number of spaces.

        See also the IndentationConsistency cop which is the companion to this one.

        Example:

        # bad
        class A
         def test
          puts 'hello'
         end
        end
        
        # good
        class A
          def test
            puts 'hello'
          end
        end

        Example: IgnoredPatterns: ['^\s*module']

        # bad
        module A
        class B
          def test
          puts 'hello'
          end
        end
        end
        
        # good
        module A
        class B
          def test
            puts 'hello'
          end
        end
        end

        Surrounding space missing for operator =.
        Open

            session_tables=%w(be_sessions fe_session_data fe_sessions)

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Do not use spaces inside percent literal delimiters.
        Open

            ret =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Missing space after #.
        Open

            #system("cd current/dummy && ln -sf ../../../typo3source/typo3_src-#{version} typo3_src")

        This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

        Example:

        # bad
        #Some comment
        
        # good
        # Some comment

        Space missing after comma.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'6.2')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Place the condition on the same line as elsif.
        Open

              cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{infile}\";echo serialize($TYPO3_CONF_VARS[\"EXT\"][\"extConf\"]);\'"

        This cop checks for conditions that are not on the same line as if/while/until.

        Example:

        # bad
        
        if
          some_condition
          do_something
        end

        Example:

        # good
        
        if some_condition
          do_something
        end

        Unused block argument - k. If it's necessary, use _ or _k as an argument name to indicate that it won't be used.
        Open

            my_hash.each do |k,v|

        This cop checks for unused block arguments.

        Example:

        # bad
        
        do_something do |used, unused|
          puts used
        end
        
        do_something do |bar|
          puts :foo
        end
        
        define_method(:foo) do |bar|
          puts :baz
        end

        Example:

        #good
        
        do_something do |used, _unused|
          puts used
        end
        
        do_something do
          puts :foo
        end
        
        define_method(:foo) do |_bar|
          puts :baz
        end

        Surrounding space missing for operator =.
        Open

                extAttr['state']='active'

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Line is too long. [90/80]
        Open

          def self.make_set_localconf_database_settings_command(db,user,password,host='localhost')

        Line is too long. [105/80]
        Open

            text = text.gsub(/^\$TYPO3_CONF_VARS\['EXT'\]\['extList'\].*/, newconf+"; #{TYPO3_MODIFY_SIGNATURE}")

        Surrounding space missing for operator ==.
        Open

                 if extAttr['state']=='active'

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Line is too long. [146/80]
        Open

              cmd = "php -r '\define(\"TYPO3_MODE\", \"BE\");include \"#{TYPO3_V4_LOCAL_CONF_PATH}\";echo $TYPO3_CONF_VARS[\"EXT\"][\"#{extlistKey}\"];\'"

        Space missing inside }.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Do not prefix reader method names with get_.
        Open

          def self.get_v4_localconf_array

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not use spaces inside percent literal delimiters.
        Open

            ret =%x[ #{cmd} ]

        Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.

        Example:

        # good
        %i(foo bar baz)
        
        # bad
        %w( foo bar baz )
        
        # bad
        %x(  ls -l )

        Use snake_case for variable names.
        Open

            extList_fe = Typo3Helper::get_v4_localconf_extlist('extList_FE')

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        (...) interpreted as grouped expression.
        Open

            system (cmd)

        Checks for space between the name of a called method and a left parenthesis.

        Example:

        # bad
        
        puts (x + y)

        Example:

        # good
        
        puts(x + y)

        Use snake_case for variable names.
        Open

              _extArray= PHP.unserialize(ret)

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Avoid using {...} for multi-line blocks.
        Open

              confhash['EXT']['extConf'].each {|extkey,extconf|

        Check for uses of braces or do/end around single line or multi-line blocks.

        Example: EnforcedStyle: linecountbased (default)

        # bad - single line block
        items.each do |item| item / 5 end
        
        # good - single line block
        items.each { |item| item / 5 }
        
        # bad - multi-line block
        things.map { |thing|
          something = thing.some_method
          process(something)
        }
        
        # good - multi-line block
        things.map do |thing|
          something = thing.some_method
          process(something)
        end

        Example: EnforcedStyle: semantic

        # Prefer `do...end` over `{...}` for procedural blocks.
        
        # return value is used/assigned
        # bad
        foo = map do |x|
          x
        end
        puts (map do |x|
          x
        end)
        
        # return value is not used out of scope
        # good
        map do |x|
          x
        end
        
        # Prefer `{...}` over `do...end` for functional blocks.
        
        # return value is not used out of scope
        # bad
        each { |x|
          x
        }
        
        # return value is used/assigned
        # good
        foo = map { |x|
          x
        }
        map { |x|
          x
        }.inspect

        Example: EnforcedStyle: bracesforchaining

        # bad
        words.each do |word|
          word.flip.flop
        end.join("-")
        
        # good
        words.each { |word|
          word.flip.flop
        }.join("-")

        Omit the parentheses in defs when the method doesn't accept any arguments.
        Open

          def self.truncate_cache_tables()

        This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

        Example:

        # bad
        def foo()
          # does a thing
        end
        
        # good
        def foo
          # does a thing
        end
        
        # also good
        def foo() does_a_thing end

        Example:

        # bad
        def Baz.foo()
          # does a thing
        end
        
        # good
        def Baz.foo
          # does a thing
        end

        Use hash literal {} instead of Hash.new.
        Open

              extensionArr = Hash.new

        This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

        Example:

        # bad
        a = Array.new
        h = Hash.new
        s = String.new
        
        # good
        a = []
        h = {}
        s = ''

        Do not prefix writer method names with set_.
        Open

          def self.set_typo3_conf_vars(confvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Redundant return detected.
        Open

              return 6

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Use snake_case for variable names.
        Open

              confhash['packages'].each do |extKey, extAttr|

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 4)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Omit the parentheses in defs when the method doesn't accept any arguments.
        Open

          def self.truncate_session_tables()

        This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

        Example:

        # bad
        def foo()
          # does a thing
        end
        
        # good
        def foo
          # does a thing
        end
        
        # also good
        def foo() does_a_thing end

        Example:

        # bad
        def Baz.foo()
          # does a thing
        end
        
        # good
        def Baz.foo
          # does a thing
        end

        Prefer to_s over string interpolation.
        Open

                confVars['EXT']['extConf'][key] = "#{PHP.serialize(arr).gsub("'", "\\\\'")}"

        This cop checks for strings that are just an interpolated expression.

        Example:

        # bad
        "#{@var}"
        
        # good
        @var.to_s
        
        # good if @var is already a String
        @var

        Use a guard clause instead of wrapping the code inside a conditional expression.
        Open

            if(self.typo3_localconf_version == 6)

        Use a guard clause instead of wrapping the code inside a conditional expression

        Example:

        # bad
        def test
          if something
            work
          end
        end
        
        # good
        def test
          return unless something
          work
        end
        
        # also good
        def test
          work if something
        end
        
        # bad
        if something
          raise 'exception'
        else
          ok
        end
        
        # good
        raise 'exception' if something
        ok

        Use def with parentheses when there are parameters.
        Open

          def self.minor_version total_version

        This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

        Example: EnforcedStyle: require_parentheses (default)

        # The `require_parentheses` style requires method definitions
        # to always use parentheses
        
        # bad
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Example: EnforcedStyle: requirenoparentheses

        # The `require_no_parentheses` style requires method definitions
        # to never use parentheses
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end

        Example: EnforcedStyle: requirenoparenthesesexceptmultiline

        # The `require_no_parentheses_except_multiline` style prefers no
        # parantheses when method definition arguments fit on single line,
        # but prefers parantheses when arguments span multiple lines.
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Don't use parentheses around a variable.
        Open

            system (cmd)

        This cop checks for redundant parentheses.

        Example:

        # bad
        (x) if ((y.z).nil?)
        
        # good
        x if y.z.nil?

        Redundant self detected.
        Open

              self.set_v6_localconf_extlist(extList)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Extra empty line detected at method body beginning.
        Open

        
            version_arr = self.typo3_version_list

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Extra empty line detected at method body beginning.
        Open

        
            outfile = TYPO3_V6_LOCAL_CONF_PATH

        This cops checks if empty lines exist around the bodies of methods.

        Example:

        # good
        
        def foo
          # ...
        end
        
        # bad
        
        def bar
        
          # ...
        
        end

        Space missing after comma.
        Open

            versions_list_in << Typo3Helper::last_minor_version(versions,'7.6')

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

                DT3Div::downloadTo(srcurl,srcpath,tarball)

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space missing after comma.
        Open

            system("rm -f #{File.join('current','dummy','typo3_src')}")

        Checks for comma (,) not followed by some kind of space.

        Example:

        # bad
        [1,2]
        { foo:bar,}
        
        # good
        [1, 2]
        { foo:bar, }

        Space after keyword if is missing.
        Open

              if(self.typo3_localconf_version == 6)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Space after keyword elsif is missing.
        Open

              elsif(self.typo3_localconf_version == 4)

        Checks the spacing around the keywords.

        Example:

        # bad
        something 'test'do|x|
        end
        
        while(something)
        end
        
        something = 123if test
        
        # good
        something 'test' do |x|
        end
        
        while (something)
        end
        
        something = 123 if test

        Surrounding space missing for operator +.
        Open

              idx = idx+1

        Checks that operators have space around them, except for ** which should not have surrounding space.

        Example:

        # bad
        total = 3*4
        "apple"+"juice"
        my_number = 38/4
        a ** b
        
        # good
        total = 3 * 4
        "apple" + "juice"
        my_number = 38 / 4
        a**b

        Space missing inside }.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Space between { and | missing.
        Open

              confhash['EXT']['extConf'].each {|extkey,extconf|

        Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

        Example: EnforcedStyle: space (default)

        # The `space` style enforces that block braces have
        # surrounding space.
        
        # bad
        some_array.each {puts e}
        
        # good
        some_array.each { puts e }

        Example: EnforcedStyle: no_space

        # The `no_space` style enforces that block braces don't
        # have surrounding space.
        
        # bad
        some_array.each { puts e }
        
        # good
        some_array.each {puts e}

        Example: EnforcedStyleForEmptyBraces: no_space (default)

        # The `no_space` EnforcedStyleForEmptyBraces style enforces that
        # block braces don't have a space in between when empty.
        
        # bad
        some_array.each {   }
        some_array.each {  }
        some_array.each { }
        
        # good
        some_array.each {}

        Example: EnforcedStyleForEmptyBraces: space

        # The `space` EnforcedStyleForEmptyBraces style enforces that
        # block braces have at least a spece in between when empty.
        
        # bad
        some_array.each {}
        
        # good
        some_array.each { }
        some_array.each {  }
        some_array.each {   }

        Example: SpaceBeforeBlockParameters: true (default)

        # The SpaceBeforeBlockParameters style set to `true` enforces that
        # there is a space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each {|n| n * 2 }
        
        # good
        [1, 2, 3].each { |n| n * 2 }

        Example: SpaceBeforeBlockParameters: true

        # The SpaceBeforeBlockParameters style set to `false` enforces that
        # there is no space between `{` and `|`. Overrides `EnforcedStyle`
        # if there is a conflict.
        
        # bad
        [1, 2, 3].each { |n| n * 2 }
        
        # good
        [1, 2, 3].each {|n| n * 2 }

        Do not use prefix _ for a variable that is used.
        Open

              _extArray= PHP.unserialize(ret)

        This cop checks for underscore-prefixed variables that are actually used.

        Example:

        # bad
        
        [1, 2, 3].each do |_num|
          do_something(_num)
        end

        Example:

        # good
        
        [1, 2, 3].each do |num|
          do_something(num)
        end

        Example:

        # good
        
        [1, 2, 3].each do |_num|
          do_something # not using `_num`
        end

        Line is too long. [113/80]
        Open

            DT3Div.downloadTo('typo3.org','/fileadmin/ter/extensions.xml.gz','current/dummy/typo3temp/extensions.xml.gz')

        Do not prefix writer method names with set_.
        Open

          def self.set_v4_localconf_extlist(extList)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Avoid using {...} for multi-line blocks.
        Open

            version_arr.each { |v|

        Check for uses of braces or do/end around single line or multi-line blocks.

        Example: EnforcedStyle: linecountbased (default)

        # bad - single line block
        items.each do |item| item / 5 end
        
        # good - single line block
        items.each { |item| item / 5 }
        
        # bad - multi-line block
        things.map { |thing|
          something = thing.some_method
          process(something)
        }
        
        # good - multi-line block
        things.map do |thing|
          something = thing.some_method
          process(something)
        end

        Example: EnforcedStyle: semantic

        # Prefer `do...end` over `{...}` for procedural blocks.
        
        # return value is used/assigned
        # bad
        foo = map do |x|
          x
        end
        puts (map do |x|
          x
        end)
        
        # return value is not used out of scope
        # good
        map do |x|
          x
        end
        
        # Prefer `{...}` over `do...end` for functional blocks.
        
        # return value is not used out of scope
        # bad
        each { |x|
          x
        }
        
        # return value is used/assigned
        # good
        foo = map { |x|
          x
        }
        map { |x|
          x
        }.inspect

        Example: EnforcedStyle: bracesforchaining

        # bad
        words.each do |word|
          word.flip.flop
        end.join("-")
        
        # good
        words.each { |word|
          word.flip.flop
        }.join("-")

        Don't use parentheses around a variable.
        Open

            system (cmd)

        This cop checks for redundant parentheses.

        Example:

        # bad
        (x) if ((y.z).nil?)
        
        # good
        x if y.z.nil?

        Redundant return detected.
        Open

            return return_string

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return 'php'

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

              version['main version'] = self.major_version version_in

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            system("rm -Rf current/dummy/typo3conf/temp_CACHED_*")

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Redundant self detected.
        Open

              return self.get_v4_localconf_array

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            cmd = "rm tmpjson"

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Do not prefix writer method names with set_.
        Open

          def self.set_v6_typo3_extconf_settings(extconfvars)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Use snake_case for variable names.
        Open

              activeList = []

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

              extensionArr = Hash.new

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        %w-literals should be delimited by [ and ].
        Open

            cache_tables= %w(cache_extensions cache_hash cache_imagesizes cache_md5params cache_pages cache_pagesection cache_sys_dmail_stat cache_treelist cache_typo3temp_log cachingframework_cache_hash cachingframework_cache_hash_tags cachingframework_cache_pages cachingframework_cache_pages_tags cachingframework_cache_pagesection cachingframework_cache_pagesection_tags cf_cache_hash cf_cache_hash_tags cf_cache_pages cf_cache_pages_tags cf_cache_pagesection cf_cache_pagesection_tags cf_extbase_object cf_extbase_object_tags cf_extbase_reflection cf_extbase_reflection_tags cf_tt_news_cache cf_tt_news_cache_tags cf_tx_solr cf_tx_solr_tags tt_news_cache tt_news_cache_tags tx_realurl_chashcache tx_realurl_errorlog tx_realurl_pathcache tx_realurl_uniqalias tx_realurl_urldecodecache tx_realurl_urlencodecache tx_solr_cache tx_solr_cache_tags)

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        Redundant return detected.
        Open

              return TYPO3_V6_LOCAL_CONF_PATH

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

            self.truncate_tables(session_tables)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            if self.typo3_localconf_version == 4

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            elsif(self.typo3_localconf_version == 4)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Redundant self detected.
        Open

            if(self.typo3_localconf_version == 6)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            source = "https://get.typo3.org/json"

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            return majorversion+"."+list.sort.reverse[0].to_i.to_s

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Redundant self detected.
        Open

            elsif(self.typo3_localconf_version == '4')

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Do not use semicolons to terminate expressions.
        Open

              return extList.split(',');

        This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

        Example:

        # bad
        foo = 1; bar = 2;
        baz = 3;
        
        # good
        foo = 1
        bar = 2
        baz = 3

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

                "echo \"<?php\\n\";" \

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Do not prefix reader method names with get_.
        Open

          def self.get_db_settings

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not prefix writer method names with set_.
        Open

          def self.set_localconf_extlist(extList)

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not prefix reader method names with get_.
        Open

          def self.get_confarray_from_localconf

        This cop makes sure that accessor methods are named properly.

        Example:

        # bad
        def set_attribute(value)
        end
        
        # good
        def attribute=(value)
        end
        
        # bad
        def get_attribute
        end
        
        # good
        def attribute
        end

        Do not use :: for method calls.
        Open

            all_current_tables = capture DT3MySQL::show_tables.split("\n")

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Do not use :: for method calls.
        Open

            extList_fe = Typo3Helper::get_v4_localconf_extlist('extList_FE')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Missing top-level class documentation comment.
        Open

        class Typo3Helper

        This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

        The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

        Example:

        # bad
        class Person
          # ...
        end
        
        # good
        # Description/Explanation of Person class
        class Person
          # ...
        end

        Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
        Open

            unless File.directory?('typo3source')

        Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

        Example:

        # bad
        if condition
          do_stuff(bar)
        end
        
        unless qux.empty?
          Foo.do_something
        end
        
        # good
        do_stuff(bar) if condition
        Foo.do_something unless qux.empty?

        Redundant self detected.
        Open

              versions = self.get_typo3_versions

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

                "var_export($arr);" \

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Redundant self detected.
        Open

              confhash = self.get_v6_localconf_array

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Do not use semicolons to terminate expressions.
        Open

            system('gunzip -c current/dummy/typo3temp/extensions.xml.gz > current/dummy/typo3temp/extensions.xml');

        This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

        Example:

        # bad
        foo = 1; bar = 2;
        baz = 3;
        
        # good
        foo = 1
        bar = 2
        baz = 3

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            system("rm -Rf current/dummy/typo3conf/temp_CACHED_*")

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Use self-assignment shorthand +=.
        Open

              idx = idx+1

        This cop enforces the use the shorthand for self-assignment.

        Example:

        # bad
        x = x + 1
        
        # good
        x += 1

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

              return_string << "TYPO3 version: "+ v+ "\n"

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            system("rm -Rf current/dummy/typo3temp/*")

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Do not use :: for method calls.
        Open

            extList = Typo3Helper::get_v4_localconf_extlist('extList')

        This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

        Example:

        # bad
        Timeout::timeout(500) { do_something }
        FileUtils::rmdir(dir)
        Marshal::dump(obj)
        
        # good
        Timeout.timeout(500) { do_something }
        FileUtils.rmdir(dir)
        Marshal.dump(obj)

        Use backticks around command string.
        Open

            ret =%x[ #{cmd} ]

        This cop enforces using `` or %x around command literals.

        Example: EnforcedStyle: backticks (default)

        # bad
        folders = %x(find . -type d).split
        
        # bad
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )
        
        # good
        folders = `find . -type d`.split
        
        # good
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `

        Example: EnforcedStyle: mixed

        # bad
        folders = %x(find . -type d).split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = `find . -type d`.split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: EnforcedStyle: percent_x

        # bad
        folders = `find . -type d`.split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = %x(find . -type d).split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: AllowInnerBackticks: false (default)

        # If `false`, the cop will always recommend using `%x` if one or more
        # backticks are found in the command string.
        
        # bad
        `echo \`ls\``
        
        # good
        %x(echo `ls`)

        Example: AllowInnerBackticks: true

        # good
        `echo \`ls\``

        Use backticks around command string.
        Open

              ret =%x[ #{cmd} ]

        This cop enforces using `` or %x around command literals.

        Example: EnforcedStyle: backticks (default)

        # bad
        folders = %x(find . -type d).split
        
        # bad
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )
        
        # good
        folders = `find . -type d`.split
        
        # good
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `

        Example: EnforcedStyle: mixed

        # bad
        folders = %x(find . -type d).split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = `find . -type d`.split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: EnforcedStyle: percent_x

        # bad
        folders = `find . -type d`.split
        
        # bad
        `
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        `
        
        # good
        folders = %x(find . -type d).split
        
        # good
        %x(
          ln -s foo.example.yml foo.example
          ln -s bar.example.yml bar.example
        )

        Example: AllowInnerBackticks: false (default)

        # If `false`, the cop will always recommend using `%x` if one or more
        # backticks are found in the command string.
        
        # bad
        `echo \`ls\``
        
        # good
        %x(echo `ls`)

        Example: AllowInnerBackticks: true

        # good
        `echo \`ls\``

        Use a guard clause instead of wrapping the code inside a conditional expression.
        Open

            if(CONFIG['TYPO3_MAIN_VERSION'].to_s.split('.')[0].to_i > 4)

        Use a guard clause instead of wrapping the code inside a conditional expression

        Example:

        # bad
        def test
          if something
            work
          end
        end
        
        # good
        def test
          return unless something
          work
        end
        
        # also good
        def test
          work if something
        end
        
        # bad
        if something
          raise 'exception'
        else
          ok
        end
        
        # good
        raise 'exception' if something
        ok

        Use def with parentheses when there are parameters.
        Open

          def self.major_version total_version

        This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

        Example: EnforcedStyle: require_parentheses (default)

        # The `require_parentheses` style requires method definitions
        # to always use parentheses
        
        # bad
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Example: EnforcedStyle: requirenoparentheses

        # The `require_no_parentheses` style requires method definitions
        # to never use parentheses
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end

        Example: EnforcedStyle: requirenoparenthesesexceptmultiline

        # The `require_no_parentheses_except_multiline` style prefers no
        # parantheses when method definition arguments fit on single line,
        # but prefers parantheses when arguments span multiple lines.
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        %x-literals should be delimited by ( and ).
        Open

            dbsettings =%x[ #{cmd} ].split(' ')

        This cop enforces the consistent usage of %-literal delimiters.

        Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

        Example:

        # Style/PercentLiteralDelimiters:
        #   PreferredDelimiters:
        #     default: '[]'
        #     '%i':    '()'
        
        # good
        %w[alpha beta] + %i(gamma delta)
        
        # bad
        %W(alpha #{beta})
        
        # bad
        %I(alpha beta)

        Redundant return detected.
        Open

            return typo3_version

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return TYPO3_V4_LOCAL_CONF_PATH

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return JSON.parse(json)

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

              return self.get_v4_localconf_array

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant return detected.
        Open

            return true

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            version_m = total_version.split "."

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

                "echo \"return \";" \

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            content = ""

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            cmd = "rm tmpjson"

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Use snake_case for variable names.
        Open

            newconf_FE= "$TYPO3_CONF_VARS['EXT']['extList_FE'] = '#{extList_fe.join(',')}'"

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Use snake_case for variable names.
        Open

              extensionArr = Hash.new

        This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

        Example: EnforcedStyle: snake_case (default)

        # bad
        fooBar = 1
        
        # good
        foo_bar = 1

        Example: EnforcedStyle: camelCase

        # bad
        foo_bar = 1
        
        # good
        fooBar = 1

        Omit the parentheses in defs when the method doesn't accept any arguments.
        Open

          def self.flush_cache()

        This cop checks for parentheses in the definition of a method, that does not take any arguments. Both instance and class/singleton methods are checked.

        Example:

        # bad
        def foo()
          # does a thing
        end
        
        # good
        def foo
          # does a thing
        end
        
        # also good
        def foo() does_a_thing end

        Example:

        # bad
        def Baz.foo()
          # does a thing
        end
        
        # good
        def Baz.foo
          # does a thing
        end

        Use hash literal {} instead of Hash.new.
        Open

              version = Hash.new

        This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash or string.

        Example:

        # bad
        a = Array.new
        h = Hash.new
        s = String.new
        
        # good
        a = []
        h = {}
        s = ''

        Favor format over sprintf.
        Open

                  list << sprintf('%02d',line.chomp[19,2])

        This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.

        The detection of String#% cannot be implemented in a reliable manner for all cases, so only two scenarios are considered - if the first argument is a string literal and if the second argument is an array literal.

        Example: EnforcedStyle: format(default)

        # bad
        puts sprintf('%10s', 'hoge')
        puts '%10s' % 'hoge'
        
        # good
        puts format('%10s', 'hoge')

        Example: EnforcedStyle: sprintf

        # bad
        puts format('%10s', 'hoge')
        puts '%10s' % 'hoge'
        
        # good
        puts sprintf('%10s', 'hoge')

        Example: EnforcedStyle: percent

        # bad
        puts format('%10s', 'hoge')
        puts sprintf('%10s', 'hoge')
        
        # good
        puts '%10s' % 'hoge'

        Use def with parentheses when there are parameters.
        Open

          def self.download_typo3_source version

        This cops checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

        Example: EnforcedStyle: require_parentheses (default)

        # The `require_parentheses` style requires method definitions
        # to always use parentheses
        
        # bad
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Example: EnforcedStyle: requirenoparentheses

        # The `require_no_parentheses` style requires method definitions
        # to never use parentheses
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end

        Example: EnforcedStyle: requirenoparenthesesexceptmultiline

        # The `require_no_parentheses_except_multiline` style prefers no
        # parantheses when method definition arguments fit on single line,
        # but prefers parantheses when arguments span multiple lines.
        
        # bad
        def bar(num1, num2)
          num1 + num2
        end
        
        def foo descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name
          do_something
        end
        
        # good
        def bar num1, num2
          num1 + num2
        end
        
        def foo(descriptive_var_name,
                another_descriptive_var_name,
                last_descriptive_var_name)
          do_something
        end

        Redundant return detected.
        Open

            return majorversion+"."+list.sort.reverse[0].to_i.to_s

        This cop checks for redundant return expressions.

        Example:

        def test
          return something
        end
        
        def test
          one
          two
          three
          return something
        end

        It should be extended to handle methods whose body is if/else or a case expression with a default branch.

        Redundant self detected.
        Open

              elsif(self.typo3_localconf_version == 4)

        This cop checks for redundant uses of self.

        The usage of self is only needed when:

        • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

        • Calling an attribute writer to prevent an local variable assignment.

        Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

        Note we allow uses of self with operators because it would be awkward otherwise.

        Example:

        # bad
        def foo(bar)
          self.baz
        end
        
        # good
        def foo(bar)
          self.bar  # Resolves name clash with the argument.
        end
        
        def foo
          bar = 1
          self.bar  # Resolves name clash with the local variable.
        end
        
        def foo
          %w[x y z].select do |bar|
            self.bar == bar  # Resolves name clash with argument of the block.
          end
        end

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

                srcurl = "get.typo3.org"

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            File.open(TYPO3_V4_LOCAL_CONF_PATH, "w") {|file| file.puts text}

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            return_string = ""

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        Prefer single-quoted strings when you don't need string interpolation or special symbols.
        Open

            version_m = total_version.split "."

        Checks if uses of quotes match the configured preference.

        Example: EnforcedStyle: single_quotes (default)

        # bad
        "No special symbols"
        "No string interpolation"
        "Just text"
        
        # good
        'No special symbols'
        'No string interpolation'
        'Just text'
        "Wait! What's #{this}!"

        Example: EnforcedStyle: double_quotes

        # bad
        'Just some text'
        'No special chars or interpolation'
        
        # good
        "Just some text"
        "No special chars or interpolation"
        "Every string in #{project} uses double_quotes"

        There are no issues that match your filters.

        Category
        Status