diff --git a/lib/rubycritic/core/analysed_file.rb b/lib/rubycritic/core/analysed_file.rb
index <HASH>..<HASH> 100644
--- a/lib/rubycritic/core/analysed_file.rb
+++ b/lib/rubycritic/core/analysed_file.rb
@@ -31,9 +31,11 @@ module Rubycritic
     end
 
     def complexity_per_method
-      complexity.fdiv(methods_count).round(1)
-    rescue ZeroDivisionError
-      "N/A"
+      if methods_count == 0
+        "N/A"
+      else
+        complexity.fdiv(methods_count).round(1)
+      end
     end
 
     def has_smells?
Fix dividing by zero

(Never thought I'd ever write this aha)