  In order to better analyse the polarization of the cosmic microwave
background (CMB), which is dominated by emission from our Galaxy, we need tools
that can detect residual foregrounds in cleaned CMB maps. Galactic foregrounds
introduce statistical anisotropy and directionality to the polarization
pseudo-vectors of the CMB, which can be investigated by using the D statistic
of Bunn and Scott. This statistic is rapidly computable and capable of
investigating a broad range of data products for directionality. We demonstrate
the application of this statistic to detecting foregrounds in polarization maps
by analysing the uncleaned Planck 2018 frequency maps. For the Planck 2018 CMB
maps, we find no evidence for residual foreground contamination. In order to
examine the sensitivity of the D statistic, we add a varying fraction of the
polarized thermal dust and synchrotron foreground maps to the CMB maps and show
the percent-level foreground contamination that would be detected with 95
percent confidence. We also demonstrate application of the D statistic to
another data product by analysing the gradient of the minimum-variance CMB
lensing potential map (i.e., the deflection angle) for directionality. We find
no excess directionality in the lensing potential map when compared to the
simulations provided by the Planck Collaboration.
