Global Metrics

path: .metrics.cyclomatic.sum
old: 2.0
new: 4.0

path: .metrics.halstead.estimated_program_length
old: 53.5635228093372
new: 182.10941063497395

path: .metrics.halstead.length
old: 25.0
new: 90.0

path: .metrics.halstead.level
old: 0.3055555555555555
new: 0.164021164021164

path: .metrics.halstead.bugs
old: 0.016060085012253596
new: 0.06810094839963302

path: .metrics.halstead.vocabulary
old: 17.0
new: 40.0

path: .metrics.halstead.volume
old: 102.18657103125848
new: 478.9735285398626

path: .metrics.halstead.effort
old: 334.42877792048233
new: 2920.1934481946464

path: .metrics.halstead.purity_ratio
old: 2.142540912373488
new: 2.0234378959441552

path: .metrics.halstead.n1
old: 6.0
new: 9.0

path: .metrics.halstead.n2
old: 11.0
new: 31.0

path: .metrics.halstead.time
old: 18.57937655113791
new: 162.23296934414702

path: .metrics.halstead.N2
old: 12.0
new: 42.0

path: .metrics.halstead.N1
old: 13.0
new: 48.0

path: .metrics.halstead.difficulty
old: 3.272727272727273
new: 6.096774193548387

path: .metrics.loc.ploc
old: 12.0
new: 27.0

path: .metrics.loc.blank
old: 5.0
new: 12.0

path: .metrics.loc.cloc
old: 6.0
new: 26.0

path: .metrics.loc.sloc
old: 23.0
new: 65.0

path: .metrics.mi.mi_visual_studio
old: 55.9565101150758
new: 41.14758508885371

path: .metrics.mi.mi_original
old: 95.68563229677964
new: 70.36237050193985

path: .metrics.mi.mi_sei
old: 98.1098319720549
new: 67.7370535981739

Spaces Data

Minimal test - lines (13, 63)

path: .spaces[0].metrics.mi.mi_visual_studio
old: 63.82486517826764
new: 43.783245130503225

path: .spaces[0].metrics.mi.mi_sei
old: 104.37236759197548
new: 73.8665593643205

path: .spaces[0].metrics.mi.mi_original
old: 109.14051945483766
new: 74.86934917316051

path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 3.0

path: .spaces[0].metrics.halstead.N2
old: 8.0
new: 38.0

path: .spaces[0].metrics.halstead.level
old: 0.3333333333333333
new: 0.16374269005847955

path: .spaces[0].metrics.halstead.n2
old: 8.0
new: 28.0

path: .spaces[0].metrics.halstead.time
old: 13.325742227201616
new: 152.00440713281614

path: .spaces[0].metrics.halstead.N1
old: 13.0
new: 48.0

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.881417857348902
new: 1.8969216608208572

path: .spaces[0].metrics.halstead.effort
old: 239.86336008962908
new: 2736.0793283906905

path: .spaces[0].metrics.halstead.length
old: 21.0
new: 86.0

path: .spaces[0].metrics.halstead.n1
old: 6.0
new: 9.0

path: .spaces[0].metrics.halstead.volume
old: 79.9544533632097
new: 448.0129894440897

path: .spaces[0].metrics.halstead.estimated_program_length
old: 39.50977500432694
new: 163.13526283059372

path: .spaces[0].metrics.halstead.vocabulary
old: 14.0
new: 37.0

path: .spaces[0].metrics.halstead.bugs
old: 0.0128683052427308
new: 0.06520754782436712

path: .spaces[0].metrics.halstead.difficulty
old: 3.0
new: 6.107142857142857

path: .spaces[0].metrics.loc.sloc
old: 11.0
new: 51.0

path: .spaces[0].metrics.loc.blank
old: 3.0
new: 9.0

path: .spaces[0].metrics.loc.ploc
old: 7.0
new: 22.0

path: .spaces[0].metrics.loc.cloc
old: 1.0
new: 20.0

Code

namespace mozilla {
namespace widget {

#if defined(MOZ_WIDGET_GTK)

// Our nsLookAndFeel for Gtk relies on APIs that aren't available in headless
// mode, so for processes that are unable to connect to a display server, we use
// an implementation with hardcoded values.
//
// HeadlessLookAndFeel is used:
//
//   * in the parent process, when full headless mode (MOZ_HEADLESS=1) is
//     enabled
//   * in content processes, when full headless mode or headless content
//     mode (security.sandbox.content.headless) is enabled, unless
//     widget.remote-look-and-feel is also enabled, in which case
//     RemoteLookAndFeel is used instead.
//
// The result of this is that when headless content mode is enabled, content
// processes use values derived from the parent's nsLookAndFeel (i.e., values
// derived from Gtk APIs) while still refraining from making any display server
// connections.

class HeadlessLookAndFeel : public nsXPLookAndFeel {
 public:
  explicit HeadlessLookAndFeel(const LookAndFeelCache* aCache);
  virtual ~HeadlessLookAndFeel();

  void NativeInit() final{};
  virtual nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
  virtual nsresult NativeGetFloat(FloatID aID, float& aResult) override;
  virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
  virtual bool NativeGetFont(FontID aID, nsString& aFontName,
                             gfxFontStyle& aFontStyle) override;

  virtual void RefreshImpl() override;
  virtual char16_t GetPasswordCharacterImpl() override;
  virtual bool GetEchoPasswordImpl() override;
};

#else

// When possible, we simply reuse the platform's existing nsLookAndFeel
// implementation in headless mode.

typedef nsLookAndFeel HeadlessLookAndFeel;

#endif

}  // namespace widget
}  // namespace mozilla