diff --git a/lib/analysis/cache_persistence_analysis.rb b/lib/analysis/cache_persistence_analysis.rb
index 52a145274019508a9a5f36042959ca90ae9e52c0..cd6d6e80d001d26abedabb2fa9116e54e835329c 100644
--- a/lib/analysis/cache_persistence_analysis.rb
+++ b/lib/analysis/cache_persistence_analysis.rb
@@ -73,7 +73,7 @@ class PersistenceDataFlowAnalysis
     end
 
     def concat(set)
-      if set == ZERO || set == TOP
+      if [ZERO, TOP].include?(set)
         set.concat(self)
       else
         create(@set + set.set)
@@ -81,7 +81,7 @@ class PersistenceDataFlowAnalysis
     end
 
     def join(other)
-      return other.join(self) if other == ZERO || other == TOP
+      return other.join(self) if [ZERO, TOP].include?(other)
       create(@set + other.set)
     end
 
diff --git a/lib/analysis/cache_region_analysis.rb b/lib/analysis/cache_region_analysis.rb
index 291affbf0160312a0939022862d39de1c4137ecf..968b6beb07ee40618ddf39ca780fbe5d1ad98244 100644
--- a/lib/analysis/cache_region_analysis.rb
+++ b/lib/analysis/cache_region_analysis.rb
@@ -404,9 +404,11 @@ class CacheRegionAnalysis < CacheAnalysisBase
     end
 
     # HACK: for evaluation purposes only
+    # rubocop:disable Style/GlobalVars
     if @cache_properties.name == "I$" || @cache_properties.name == "M$"
       $imem_bytes = @cache_properties.size_in_bytes(all_tags)
     end
+    # rubocop:enable Style/GlobalVars
     if options.stats
       statistics("CACHE", "size of all reachable memory blocks for #{@cache_properties.name} (bytes)" =>
                  @cache_properties.size_in_bytes(all_tags))
@@ -919,14 +921,12 @@ class DataCacheAnalysisBase
         # Note: We assume here that we do not have unaligned stores.
         d = @memory.write_delay_aligned(@line_size)
       end
+    elsif cache_line.known?
+      d = @memory.read_delay(cache_line.address, @line_size)
     else
-      if cache_line.known?
-        d = @memory.read_delay(cache_line.address, @line_size)
-      else
-        # Note: We assume here that we do not have
-        # unaligned accesses across multiple cache lines.
-        d = @memory.read_delay_aligned(@line_size)
-      end
+      # Note: We assume here that we do not have
+      # unaligned accesses across multiple cache lines.
+      d = @memory.read_delay_aligned(@line_size)
     end
     # info("read_delay for cache_line at #{cache_line.address} (#{cache_line.address & (@cache.line_size-1)}): #{d}")
     d
diff --git a/lib/analysis/dfa.rb b/lib/analysis/dfa.rb
index 6c3a52ad19cc26402f5af47dc59428f1d7ee5c49..84344018538e3536ae9cee4c47e01ae9cadab223 100644
--- a/lib/analysis/dfa.rb
+++ b/lib/analysis/dfa.rb
@@ -243,6 +243,7 @@ class DataFlowAnalysis
       if bundles.empty?
         node = Node.new
       else
+        # rubocop:disable Style/IfInsideElse
         # Is this a return block or does the block have a sucessor outside the region?
         if b.successors.empty? || (targets.length < b.successors.length)
           # Then we have an exit node
@@ -251,6 +252,7 @@ class DataFlowAnalysis
         else
           node = Node.new(bundles.last)
         end
+        # rubocop:enable Style/IfInsideElse
       end
       add_node(b, node, last, first_node, targets, pred_nodes)
     end
diff --git a/lib/analysis/ipet.rb b/lib/analysis/ipet.rb
index 844106415667ab07b1f18db149ab09cb4a25b987..42957f424c7907ec7640143573fcec78f2432cf2 100644
--- a/lib/analysis/ipet.rb
+++ b/lib/analysis/ipet.rb
@@ -165,7 +165,7 @@ class IPETEdge
 
   def cfg_edge
     assert("IPETEdge#cfg_edge: not a edge between blocks") { cfg_edge? }
-    (:exit == target) ? source.edge_to_exit : source.edge_to(target)
+    :exit == target ? source.edge_to_exit : source.edge_to(target)
   end
 
   def call_edge?
diff --git a/lib/analysis/trace.rb b/lib/analysis/trace.rb
index 63d7137c4bdbbaba07a4d513b4ffee52d96b1f18..5ceb6c90cbdb5efebb976874ad3d6db498e63689 100644
--- a/lib/analysis/trace.rb
+++ b/lib/analysis/trace.rb
@@ -316,6 +316,10 @@ class VerboseRecorder
     @out = out
   end
 
+  def respond_to_missing?(method_name, include_private = false)
+    super
+  end
+
   def method_missing(event, *args)
     @out.puts("EVENT #{event.to_s.ljust(15)} #{args.join(" ")}")
   end
@@ -504,6 +508,10 @@ class RecorderScheduler
 
   def eof; end
 
+  def respond_to_missing?(method_name, include_private = false)
+    super
+  end
+
   def method_missing(event, *args); end
 end
 
@@ -599,6 +607,10 @@ class FunctionRecorder
 
   def eof; end
 
+  def respond_to_missing?(method_name, include_private = false)
+    super
+  end
+
   def method_missing(event, *args); end
 
   def to_s
@@ -693,7 +705,10 @@ class FrequencyRecord
   end
 
   def dump(io = $DEFAULT_OUTPUT, header = nil)
-    (io.puts "No records"; return) unless @blockfreqs
+    unless @blockfreqs
+      io.puts "No records"
+      return
+    end
     io.puts "---"
     io.puts header if header
     io.puts "  cycles: #{cycles}"
@@ -781,6 +796,10 @@ class ProgressTraceRecorder
 
   def eof; end
 
+  def respond_to_missing?(method_name, include_private = false)
+    super
+  end
+
   def method_missing(event, *args); end
 end
 
diff --git a/lib/analysis/transform.rb b/lib/analysis/transform.rb
index 744d03d3ed6146da2bcd2256c1a3ff300a20f159..7b8bdb3536c48c6dfcb4aae26e784217f75dcf81 100644
--- a/lib/analysis/transform.rb
+++ b/lib/analysis/transform.rb
@@ -533,7 +533,10 @@ private
           edges = [IPETEdge.new(b,:exit,target_level)] if b.may_return?
           min_coeff = edges.map { |e| lhs[e] }.min
           if min_coeff != 0
-            edges.each { |e| lhs[e] -= min_coeff; lhs.delete(e) if lhs[e] == 0 }
+            edges.each do |e|
+              lhs[e] -= min_coeff
+              lhs.delete(e) if lhs[e] == 0
+            end
             lhs[b] += min_coeff
           end
         end
diff --git a/lib/analysis/wca.rb b/lib/analysis/wca.rb
index fd7f47286b86097d190c7fcb18e03758b6b5f7ba..ef2638353b55b7da1951a212586dba63c0275cc0 100644
--- a/lib/analysis/wca.rb
+++ b/lib/analysis/wca.rb
@@ -163,7 +163,7 @@ class WCA
       constraints = vis.get_constraints
       srchints    = vis.get_srchints
 
-      # Hacky, but a passable wörk-around for returning this metadata for
+      # Hacky, but a passable work-around for returning this metadata for
       # visualisation interact.rb...
       if @options.visualize_ilp.is_a?(Hash)
         @options.visualize_ilp[:ilp] = {
@@ -200,11 +200,10 @@ class WCA
             die("ILP cost: source is not a block") unless v.source.kind_of?(Block)
             die("ILP cost: target is not a block") unless v.target == :exit || v.target.kind_of?(Block)
             ref = ContextRef.new(v.cfg_edge, Context.empty)
-            edgefreqs[ref] = freq
           else
             ref = ContextRef.new(v.cfg_edge, Context.empty)
-            edgefreqs[ref] = freq
           end
+          edgefreqs[ref] = freq
         elsif v.kind_of?(MemoryEdge)
           ref = ContextRef.new(v.edgeref, Context.empty)
         end
diff --git a/lib/arch/patmos.rb b/lib/arch/patmos.rb
index 6bd08592e93561a444e6f2a08e7352370c3a9778..42a987a529ceb6d218228503e1f194e8580c16bb 100644
--- a/lib/arch/patmos.rb
+++ b/lib/arch/patmos.rb
@@ -140,40 +140,31 @@ private
     case instr
     when "add", "sub", "and"
       ret['opcode'] = instr.upcase + (reg_args == 3 ? "r" : "i")
-      ret
     when "li"
       ret['opcode'] = (size == 8 ? "LIl" : "LIi")
-      ret
     when "clr", "mov"
       ret['opcode'] = "MOV"
-      ret
     when "nop", "mfs", "mts"
       ret['opcode'] = instr.upcase
-      ret
     when "sws", "swm", "swl", "swc", "lwl", "lwm", "lwc"
       ret['opcode'] = instr.upcase
       ret['memode'] = { "s" => "store", "l" => "load" }[instr[0]]
       ret['memtype'] = { "l" => "local", "m" => "memory", "s" => "stack", "c" => "cache" }[instr[2]]
-      ret
     when "ret", "retnd", "xret"
       ret['opcode'] = instr.upcase
       ret['branch-type'] = "return"
-      ret
     when "call", "callnd"
       ret['opcode'] = instr.upcase
       ret['branch-type'] = "call"
       # FIXME: call target
       # p args.strip # <- function call
-      ret
     when "sspill", "sens"
       ret['opcode'] = instr.upcase + (reg_args == 1 ? "r" : "i")
-      ret
-
     else
       ret['opcode'] = [instr, args]
       ret['invalid'] = true
-      ret
     end
+    ret
   end
   RE_HEX = /[0-9A-Fa-f]/
   RE_FUNCTION_LABEL = %r{ ^
diff --git a/lib/core/arch.rb b/lib/core/arch.rb
index fdcf40ecca26d2a44197509766ff3684b8ab2371..541b414e20cd2b0dd4691958f8f71e8098dedf49 100644
--- a/lib/core/arch.rb
+++ b/lib/core/arch.rb
@@ -7,7 +7,9 @@ module PML
 
 # architectures
 class Architecture
+  # rubocop:disable Style/ClassVars
   @@register = {}
+  # rubocop:enable Style/ClassVars
   def self.register(archname,klass)
     die("architecture #{archname} already registered to #{@@register[archname]}") if @@register[archname]
     @@register[archname] = klass
diff --git a/lib/core/context.rb b/lib/core/context.rb
index 223f248dc01c14dbe30a6629f49377eb4a7272f2..e9d8f63e09a3f903c8ccf564bc2ccf686d02019d 100644
--- a/lib/core/context.rb
+++ b/lib/core/context.rb
@@ -11,7 +11,9 @@ module PML
 # Stacks with bounded memory
 class BoundedStack
   # fly-weight, to get cheaper comparisons (profile hotspot)
+  # rubocop:disable Style/ClassVars
   @@repository = {}
+  # rubocop:enable Style/ClassVars
   attr_reader :stack
   def self.empty
     BoundedStack.create([])
@@ -294,12 +296,10 @@ class LoopContextEntry < ContextEntry
       assert("LoopContextEntry: step #{step} does not match unroll factor #{unroll}") { step == unroll }
       assert("LoopContextEntry: offset #{offset} to small for peel factor #{peel}")   { offset >= peel }
       [peel + (offset - peel) % unroll, unroll]
+    elsif offset >= peel
+      [peel + (offset - peel) % unroll, unroll]
     else
-      if offset >= peel
-        [peel + (offset - peel) % unroll, unroll]
-      else
-        [offset, 0]
-      end
+      [offset, 0]
     end
   end
 
diff --git a/lib/core/pml.rb b/lib/core/pml.rb
index 053563ed3811a22b9aef4ae4a26a07a52b6394b2..19c8fabe6ca5ec489e5d529982e60a7bd3b6f3a1 100644
--- a/lib/core/pml.rb
+++ b/lib/core/pml.rb
@@ -44,8 +44,10 @@ class PMLDoc
     # read-only sections
     if @data['triple']
       @triple = @data['triple'].split('-')
-      machine_config = @data['machine-configuration'] ?
-        MachineConfig.from_pml(self, @data['machine-configuration']) : nil
+      machine_config = nil
+      if @data['machine-configuration']
+        machine_config = MachineConfig.from_pml(self, @data['machine-configuration'])
+      end
       @arch = Architecture.from_triple(triple, machine_config)
     else
       @triple = nil
diff --git a/lib/core/pmlbase.rb b/lib/core/pmlbase.rb
index 6a14c61ffc5d3cef48be53d433c8560317fc77ff..fc9e975f1877da058f50990febaa58bd053ac459 100644
--- a/lib/core/pmlbase.rb
+++ b/lib/core/pmlbase.rb
@@ -209,7 +209,7 @@ module PML
     def pml_list(element_type, unique_indices = [], indices = [])
       all_indices = unique_indices + indices
       # rubocop:disable Layout/SpaceInsideStringInterpolation
-      module_eval <<-"_end_eval", __FILE__, __LINE__
+      module_eval <<-"_end_eval", __FILE__, __LINE__ + 1
         def initialize(list, existing_data = nil)
           assert("#{self.class}#initialize: list must not be nil") { list }
           @list = list
@@ -243,14 +243,14 @@ module PML
         end
       _end_eval
       all_indices.each do |index|
-        module_eval <<-"_end_eval", __FILE__, __LINE__
+        module_eval <<-"_end_eval", __FILE__, __LINE__ + 1
            def by_#{index}(key, error_if_missing = false)
                lookup(@index_#{index}, key, "#{index}", error_if_missing)
            end
          _end_eval
       end
       all_indices.each do |index|
-        module_eval <<-"_end_eval", __FILE__, __LINE__
+        module_eval <<-"_end_eval", __FILE__, __LINE__ + 1
            def keys_#{index}()
                @index_#{index}.keys
            end
@@ -261,7 +261,7 @@ module PML
 
     def pml_name_index_list(element_type, unique_indices = [], indices = [])
       pml_list(element_type, [:name,:qname] + unique_indices, indices)
-      module_eval <<-"_end_eval", __FILE__, __LINE__
+      module_eval <<-"_end_eval", __FILE__, __LINE__ + 1
         def [](arg)
           by_name(arg)
         end
diff --git a/lib/core/programinfo.rb b/lib/core/programinfo.rb
index d694e7c0775146d2eca52e6def5acb64fe757ec3..0ce6f9d68a7e657271ffea17248e17ee35e5f488 100644
--- a/lib/core/programinfo.rb
+++ b/lib/core/programinfo.rb
@@ -107,7 +107,11 @@ module PML
 
     def reject!
       rejects = []
-      @list.reject! { |ff| r = yield ff; rejects.push(r); r }
+      @list.reject! do |ff|
+        r = yield ff
+        rejects.push(r)
+        r
+      end
       data.reject! { |_ff| rejects.shift }
     end
 
@@ -235,7 +239,11 @@ module PML
 
     def reject!
       rejects = []
-      @list.reject! { |mf| r = yield mf; rejects.push(r); r }
+      @list.reject! do |mf|
+        r = yield mf
+        rejects.push(r)
+        r
+      end
       data.reject! { |_mf| rejects.shift }
     end
 
diff --git a/lib/core/utils.rb b/lib/core/utils.rb
index 2444424084289f3d6995f804641a213ab9291eea..d6d9ddb626e9c7e458863c99c9bb7549e7375584 100644
--- a/lib/core/utils.rb
+++ b/lib/core/utils.rb
@@ -262,6 +262,7 @@ module PML
     $stderr.puts(format_msg("WARNING",msg))
   end
 
+  # rubocop:disable Style/GlobalVars
   def warn_once(msg,detail = nil)
     $warn_once ||= {}
     return if $warn_once[msg]
@@ -269,6 +270,7 @@ module PML
     warn(msg + detail.to_s)
     $warn_once[msg] = true
   end
+  # rubocop:enable Style/GlobalVars
 
   def info(msg)
     $stderr.puts(format_msg("INFO",msg))
diff --git a/lib/ext/ait.rb b/lib/ext/ait.rb
index 7b447cb568a22990d42fad0f4b94a0ce6d3e6345..fe1d091115f23619319976aca9951f1f19fada59 100644
--- a/lib/ext/ait.rb
+++ b/lib/ext/ait.rb
@@ -1008,8 +1008,8 @@ class AitImport
         if routine.function
           @function_count[routine.function] = re.attributes['count'].to_i
           @function_cost[routine.function] += re.attributes['cumulative_cycles'].to_i
-        else
-          # loop cost
+        # else
+        #   loop cost
         end
 
         # extract edge cost (relative to LLVM terminology)
diff --git a/lib/ext/patmos-clang-wcet.rb b/lib/ext/patmos-clang-wcet.rb
index 0a165751c10889c105753b63a7f6b6fa0c0dd013..f970584f0fcc6332434e72387fd7ba57c74f5d6a 100755
--- a/lib/ext/patmos-clang-wcet.rb
+++ b/lib/ext/patmos-clang-wcet.rb
@@ -66,7 +66,7 @@ ARGV.each_with_index do |arg,ix|
   elsif arg =~ /-mpatmos-max-subfunction-size=(.*)/ # override
     options.override[:mc_max_sf_size] = true
   elsif arg == '-v'
-    $verbose = true # hack, but this is really prototypical for now
+    # $verbose = true # hack, but this is really prototypical for now
     options.verbose = true
   elsif arg == '--debug'
     options.debug = true
diff --git a/lib/tools/extract-symbols.rb b/lib/tools/extract-symbols.rb
index 171c16642fef4f1c9058bbf453b4d9e7619a4442..a79da45ddcddc585c98dd99620df05b33df3792f 100644
--- a/lib/tools/extract-symbols.rb
+++ b/lib/tools/extract-symbols.rb
@@ -62,7 +62,10 @@ class ExtractSymbols
   def update_pml
     @pml.machine_functions.each do |function|
       addr = @text_symbols[function.label] || @text_symbols[function.blocks.first.label]
-      (warn("No symbol for machine function #{function.to_s}"); next) unless addr
+      unless addr
+        warn("No symbol for machine function #{function.to_s}")
+        next
+      end
       ins_index = 0
       function.blocks.each do |block|
         if (block_addr = @text_symbols[block.label])
diff --git a/lib/tools/interact.rb b/lib/tools/interact.rb
index c842da3b6aa45794dbe715671cb4d6474a07a9c8..3aad9f0b49d60b5de4d8b80a2c15047972f3d485 100644
--- a/lib/tools/interact.rb
+++ b/lib/tools/interact.rb
@@ -971,11 +971,13 @@ class REPLContext
     @initial_modelfacts = nil
   end
 
+  # rubocop:disable Style/ClassVars
   @@instance = REPLContext.new
 
   def self.instance
     @@instance
   end
+  # rubocop:enable Style/ClassVars
 
   private_class_method :new
 end
@@ -985,11 +987,13 @@ class Dispatcher
     @commands = {}
   end
 
+  # rubocop:disable Style/ClassVars
   @@instance = Dispatcher.new
 
   def self.instance
     @@instance
   end
+  # rubocop:enable Style/ClassVars
 
   def register(name, command)
     @commands[name] = command
diff --git a/lib/tools/pml.rb b/lib/tools/pml.rb
index ddccb0e4f0d53f7e6df110a75785550a7abb4650..8a392b309d51fc972b6d3f9f90451e1c43da2cfc 100644
--- a/lib/tools/pml.rb
+++ b/lib/tools/pml.rb
@@ -40,7 +40,7 @@ class PMLTool
     validation_errors = validator.validate(pml.data)
     # show errors
     if validation_errors && !validation_errors.empty?
-      for e in validation_errors
+      validation_errors.each do |e|
         warn "[#{e.path}] #{e.message}"
       end
     end
@@ -104,7 +104,7 @@ class PMLTool
                    bb.qname.to_s
                  else
                    "#{bb.qname} (#{freq})"
-                  end
+                 end
                end.join(", ")
       puts "  #{marker}: #{bbstr}"
     end
diff --git a/lib/tools/pmlmod.rb b/lib/tools/pmlmod.rb
index b3184cf62160dc8f62b009633c6057391dc3bfab..c7d624e2f6f850e0df05115abdf990fdc5c56bd5 100644
--- a/lib/tools/pmlmod.rb
+++ b/lib/tools/pmlmod.rb
@@ -95,15 +95,20 @@ class PMLMatchModify
     nummod = 0
     case action
     when :clear
-      (pml_object.data[@target] = nil; nummod += 1) if data.include? @target
+      if data.include? @target
+        pml_object.data[@target] = nil
+        nummod += 1
+      end
     end
     puts "#{pml_object}: #{nummod} modification(s)" if nummod > 0
   end
 end
 
+# rubocop:disable Style/ClassAndModuleChildren
 class PML::Function
   attr_reader :labelkey
 end
+# rubocop:enable Style/ClassAndModuleChildren
 
 class PMLDoc
   def match_path(matcher)
diff --git a/lib/tools/tool-config.rb b/lib/tools/tool-config.rb
index 37d4692a8abc9955888fd3b3d71032432a490a6d..d2fbf8dc408c58fa5a5098b2efcc4606eb6aa5ff 100644
--- a/lib/tools/tool-config.rb
+++ b/lib/tools/tool-config.rb
@@ -8,7 +8,9 @@ require 'ext/ait'
 require 'English'
 include PML
 
+# rubocop:disable Style/GlobalVars
 $available_tools = ["clang", "pasim", "ait"]
+# rubocop:enable Style/GlobalVars
 
 class ToolConfigTool
   def self.add_options(opts)
@@ -49,8 +51,10 @@ class ToolConfigTool
     when 'ait'
       AISExporter.new(pml,$stdout,options).export_header
     else
+      # rubocop:disable Style/GlobalVars
       die("platin tool configuration: Unknown tool specified: #{options.tool}" \
           " (#{$available_tools.join(", ")})")
+      # rubocop:enable Style/GlobalVars
     end
   end
 
@@ -69,6 +73,7 @@ class ToolConfigTool
 end
 
 if __FILE__ == $PROGRAM_NAME
+  # rubocop:disable Style/GlobalVars
   synopsis = <<-EOF
     Configure external tools to use the correct hardware (timing) model.
     Similar to pkg-config, this tool writes the arguments to be passed to $stdout. It uses
@@ -78,6 +83,7 @@ if __FILE__ == $PROGRAM_NAME
 
     Supported Tools: #{$available_tools.join(", ")}
   EOF
+  # rubocop:enable Style/GlobalVars
   options, args = PML::optparse([], "", synopsis) do |opts|
     opts.needs_pml
     ToolConfigTool.add_options(opts)
diff --git a/lib/tools/visualisationserver.rb b/lib/tools/visualisationserver.rb
index 6299fda3489a2b2f77a441ad0ec4dd36902a0a7a..3c36a1a050f510b480f52e6dc038bf430d54b7f2 100644
--- a/lib/tools/visualisationserver.rb
+++ b/lib/tools/visualisationserver.rb
@@ -366,7 +366,9 @@ class Server
   end
 
   def start
+    # rubocop:disable Style/BlockDelimiter
     old = trap 'INT' do @server.shutdown end
+    # rubocop:enable Style/BlockDelimiter
     @server.start
     trap 'INT', old
   end