def dump(self):
        """Dump to file"""

        # NO Dump file selected -> DO NOTHING
        if self.running_config.output_file:

            # Determinate file format
            _, extension = op.splitext(self.running_config.output_file)
            extension = extension.replace(".", "")

            if extension not in self.ALLOWED_DUMP_FORMATS:
                raise PCException(
                    f"Extension of dump file is not available. "
                    f"Allowed extensions are: "
                    f"{', '.join(self.ALLOWED_DUMP_FORMATS)}")

            with open(self.running_config.output_file, "w") as f:
                if extension == "csv":
                    csv_writer = csv.writer(f)
                    csv_writer.writerow(("# Name",
                                         "CPE",
                                         "CVE",
                                         "Score",
                                         "Summary"))
                    csv_writer.writerows(self._to_csv())

                elif extension == "json":
                    json.dump(self.results,
                              f,
                              indent=4,
                              sort_keys=True)

                elif extension == "raw":
                    f.write(self._to_table())
Dump to file