diff --git a/lib/rubycritic/report_generators/base.rb b/lib/rubycritic/report_generators/base.rb
index <HASH>..<HASH> 100644
--- a/lib/rubycritic/report_generators/base.rb
+++ b/lib/rubycritic/report_generators/base.rb
@@ -23,7 +23,7 @@ module Rubycritic
       end
 
       def file_directory
-        root_directory
+        @file_directory ||= root_directory
       end
 
       def file_name
diff --git a/lib/rubycritic/report_generators/code_file.rb b/lib/rubycritic/report_generators/code_file.rb
index <HASH>..<HASH> 100644
--- a/lib/rubycritic/report_generators/code_file.rb
+++ b/lib/rubycritic/report_generators/code_file.rb
@@ -14,7 +14,7 @@ module Rubycritic
       end
 
       def file_directory
-        root_directory + @pathname.dirname
+        @file_directory ||= root_directory + @pathname.dirname
       end
 
       def file_name
diff --git a/lib/rubycritic/report_generators/current_code_file.rb b/lib/rubycritic/report_generators/current_code_file.rb
index <HASH>..<HASH> 100644
--- a/lib/rubycritic/report_generators/current_code_file.rb
+++ b/lib/rubycritic/report_generators/current_code_file.rb
@@ -5,7 +5,7 @@ module Rubycritic
 
     class CurrentCodeFile < CodeFile
       def file_directory
-        root_directory
+        @file_directory ||= root_directory
       end
 
       def file_name
Use Ruby's ||= operator to cache the @file_directory instance variable