Example #1
0
 def write_results(self, output_dir):
     writer.write_dataframe_to_xls(
         self._analysis_result,
         "changed_lines_per_package.xls",
         output_dir,
         "Changes since " + self._workspace.since,
     )
     tm_data = self._create_tm_data()
     plot.plot_treemap(
         tm_data,
         "Number of changed lines per packag since " +
         self._workspace.since,
         output_dir,
         "changed_lines_per_package.pdf",
         "changes:",
     )
Example #2
0
    def test_plot_treemap_plots_exp_treemap_if_data_extends_max_limit(self):
        dummy_data = [
            ["Entry name %s" % dummy_val, dummy_val] for dummy_val in list(range(1, 22))
        ]
        dummy_dataframe = pd.DataFrame(dummy_data)

        sut.plot_treemap(
            dummy_dataframe,
            "dummyTitle",
            self._test_results_folder,
            self._used_file_name,
            "value label",
        )

        reporttest.assert_images_equal(
            self._treemap_output_path, self._ref_treemap_path
        )
Example #3
0
    def write_results(self, output_dir):
        writer.write_dataframe_to_xls(
            self._analysis_result,
            "cognitive_complexity_per_project.xls",
            output_dir,
            "Project Complexity",
        )
        tm_data = self._analysis_result.drop(columns=["Path"])
        tm_data = tm_data[tm_data["Complexity"] > 0]

        plot.plot_treemap(
            tm_data,
            "Cognitive complexity per project",
            output_dir,
            "cognitive_complexity_per_project.pdf",
            "complexity:",
        )
Example #4
0
    def test_plot_treemap_wraps_long_labels(self):
        dummy_data = [
            ["Entry name with long long long label %s" % dummy_val, dummy_val]
            for dummy_val in list(range(1, 21))
        ]
        dummy_dataframe = pd.DataFrame(dummy_data)

        sut.plot_treemap(
            dummy_dataframe,
            "dummyTitle",
            self._test_results_folder,
            self._used_file_name,
            "",
        )

        reporttest.assert_images_equal(
            self._treemap_output_path, self._ref_treemap_path_longlabels
        )
Example #5
0
 def _plot_treemaps(self, output_dir):
     total_comp = self._create_treemap_data(_COLUMNS[1])
     avm_comp = self._create_treemap_data(_COLUMNS[2])
     avt_comp = self._create_treemap_data(_COLUMNS[3])
     plot.plot_treemap(
         total_comp,
         "Cognitive complexity per package",
         output_dir,
         "cognitive_complexity_per_package.pdf",
         "complexity:",
     )
     plot.plot_treemap(
         avm_comp,
         "av method complexity per package",
         output_dir,
         "av_method_complexity_per_package.pdf",
         "avm complexity:",
     )
     plot.plot_treemap(
         avt_comp,
         "av class complexity per package",
         output_dir,
         "av_class_complexity_per_package.pdf",
         "avc complexity:",
     )