# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2015-08-18 22:54:59 +0100 using RuboCop version 0.33.0.
+# on 2016-10-20 21:45:03 +0100 using RuboCop version 0.44.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
-# Offense count: 1
-Lint/HandleExceptions:
- Exclude:
- - 'cookbooks/networking/definitions/firewall_rule.rb'
-
# Offense count: 22
Metrics/AbcSize:
- Max: 66
+ Max: 57
+
+# Offense count: 27
+# Configuration parameters: CountComments.
+Metrics/BlockLength:
+ Max: 356
# Offense count: 3
Metrics/CyclomaticComplexity:
Max: 8
-# Offense count: 338
-# Configuration parameters: AllowURI, URISchemes.
+# Offense count: 475
+# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives.
+# URISchemes: http, https
Metrics/LineLength:
Max: 696
-# Offense count: 23
+# Offense count: 24
# Configuration parameters: CountComments.
Metrics/MethodLength:
- Max: 40
+ Max: 24
# Offense count: 1
Metrics/PerceivedComplexity:
Max: 9
-# Offense count: 14
+# Offense count: 13
Style/Documentation:
Exclude:
+ - 'spec/**/*'
+ - 'test/**/*'
- 'cookbooks/chef/libraries/compare_versions.rb'
- 'cookbooks/chef/libraries/edit_file.rb'
- 'cookbooks/chef/libraries/random_password.rb'
- - 'cookbooks/chef/libraries/remote_directory.rb'
- 'cookbooks/chef/libraries/subversion.rb'
- 'cookbooks/hardware/libraries/sensors.rb'
- 'cookbooks/munin/libraries/expand.rb'
- 'cookbooks/tile/files/default/ruby/expire.rb'
- 'cookbooks/wordpress/libraries/wordpress.rb'
-# Offense count: 19
+# Offense count: 14
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
Style/IfUnlessModifier:
Exclude:
- 'cookbooks/accounts/recipes/default.rb'
- - 'cookbooks/apache/providers/conf.rb'
- 'cookbooks/apache/providers/module.rb'
- 'cookbooks/chef/libraries/compare_versions.rb'
- 'cookbooks/exim/recipes/default.rb'
- 'cookbooks/munin/recipes/default.rb'
- 'cookbooks/nodejs/recipes/default.rb'
- 'cookbooks/tile/files/default/ruby/expire.rb'
- - 'cookbooks/tile/recipes/default.rb'
- 'cookbooks/tools/recipes/default.rb'
- - 'cookbooks/web/recipes/cgimap.rb'
-# Offense count: 28
+# Offense count: 37
# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 11
end
end
- if details[:status] == "administrator"
- administrators.push(name.to_s)
- end
+ administrators.push(name.to_s) if details[:status] == "administrator"
else
user name.to_s do
action :remove
use_inline_resources
action :install do
- unless installed?
- package package_name
- end
+ package package_name unless installed?
if new_resource.conf # ~FC023
template available_name("conf") do
class Chef
class Util
def self.compare_versions(a, b)
- if a.is_a?(String)
- a = a.split(".").map(&:to_i)
- end
+ a = a.split(".").map(&:to_i) if a.is_a?(String)
- if b.is_a?(String)
- b = b.split(".").map(&:to_i)
- end
+ b = b.split(".").map(&:to_i) if b.is_a?(String)
a <=> b
end
package "openssl"
package "ssl-cert"
-if File.exist?("/var/run/clamav/clamd.ctl")
- package "exim4-daemon-heavy"
-end
+package "exim4-daemon-heavy" if File.exist?("/var/run/clamav/clamd.ctl")
group "ssl-cert" do
action :modify
if node[:kernel] && node[:kernel][:modules]
raidmods = node[:kernel][:modules].keys & %w(cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid)
- unless raidmods.empty?
- default[:apt][:sources] |= ["hwraid"]
- end
+ default[:apt][:sources] |= ["hwraid"] unless raidmods.empty?
end
if node[:kernel][:modules].include?("ipmi_si")
case node[:cpu][:"0"][:vendor_id]
when "AuthenticAMD"
- if node[:lsb][:release].to_f >= 14.04
- package "amd64-microcode"
- end
+ package "amd64-microcode" if node[:lsb][:release].to_f >= 14.04
end
if node[:dmi] && node[:dmi][:system]
action [:enable, :start]
end
-if node[:kernel][:modules].include?("ipmi_si")
- package "ipmitool"
-end
+package "ipmitool" if node[:kernel][:modules].include?("ipmi_si")
if node[:lsb][:release].to_f >= 12.10
package "irqbalance"
property :resample, String, :default => "average"
property :imagemode, String
property :extension, String, :default => "png"
-property :max_zoom, Fixnum, :default => 18
+property :max_zoom, Integer, :default => 18
property :url_aliases, [String, Array], :default => []
-property :revision, Fixnum, :default => 0
+property :revision, Integer, :default => 0
property :overlay, [TrueClass, FalseClass], :default => false
property :default_layer, [TrueClass, FalseClass], :default => false
sensors_volt = true unless Dir.glob("#{hwmon}/in*_input").empty?
end
-if sensors_fan || sensors_temp || sensors_volt
- package "lm-sensors"
-end
+package "lm-sensors" if sensors_fan || sensors_temp || sensors_volt
if sensors_fan
munin_plugin "sensors_fan" do
package "g++"
package "make"
-if node[:lsb][:release].to_f >= 14.04
- package "nodejs-legacy"
-end
+package "nodejs-legacy" if node[:lsb][:release].to_f >= 14.04
property :type, String,
:default => "simple",
:is => %w(simple forking oneshot dbus notify idle)
-property :limit_nofile, Fixnum
+property :limit_nofile, Integer
property :environment, Hash, :default => {}
property :environment_file, [String, Hash]
property :user, String
property :exec_stop, String
property :exec_reload, String
property :runtime_directory, String
-property :runtime_directory_mode, Fixnum
+property :runtime_directory_mode, Integer
property :standard_input, String,
:is => %w(null tty tty-force tty-fail socket)
property :standard_output, String,
property :private_network, [TrueClass, FalseClass]
property :protect_system, [TrueClass, FalseClass, String]
property :protect_home, [TrueClass, FalseClass, String]
-property :timeout_sec, Fixnum
+property :timeout_sec, Integer
property :pid_file, String
action :create do
# added, deleted or modified - the tile will need updating anyway.
doc.find("//node").each do |node|
lat = node["lat"].to_f
- if lat < -85
- lat = -85
- end
- if lat > 85
- lat = 85
- end
+ lat = -85 if lat < -85
+ lat = 85 if lat > 85
point = Proj4::Point.new(Math::PI * node["lon"].to_f / 180,
Math::PI * lat / 180)
nodes[node["id"].to_i] = tile_from_latlon(point, max_zoom)
lon, lat = @cache.sysread(8).unpack("ll")
- if lon != -2147483648 && lat != -2147483648
- node = Node.new(lon, lat)
- end
+ node = Node.new(lon, lat) if lon != -2147483648 && lat != -2147483648
end
node
package "iotop"
package "lvm2"
-if node[:lsb][:release].to_f <= 11.04
- package "lslk"
-end
+package "lslk" if node[:lsb][:release].to_f <= 11.04
package "rsyslog"