)]}'
{"bandit/core/manager.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75187546f731b9e526a68e15f02149ade0e3cb4b","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                    try:"},{"line_number":222,"context_line":"                        # parse the current file"},{"line_number":223,"context_line":"                        lines \u003d fdata.readlines()"},{"line_number":224,"context_line":"                        metrics.metrics.begin(fname)"},{"line_number":225,"context_line":"                        metrics.metrics.count_locs(lines)"},{"line_number":226,"context_line":"                        score \u003d self._execute_ast_visitor(fname, lines)"},{"line_number":227,"context_line":"                        self.scores.append(score)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_ad3ae734","line":224,"updated":"2015-10-19 15:17:55.000000000","message":"We\u0027re using an singleton that\u0027s named the same as the module containing it. Since this is our desired approach, I\u0027d rather see module level functions that operate on the singleton, e.g.,\n\n     metrics.begin(fname)\n     metrics.count_locs(lines)\n     # ...\n     metrics.count_issues([score])\n     # ...\n     metrics.aggregate()\n\nBut that doesn\u0027t need to happen in this patchset. (I think it\u0027s disorienting to see metrics.metrics.method_name())","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"}],"bandit/formatters/json.py":[{"author":{"_account_id":11861,"name":"Travis McPeak","email":"tmcpeak@us.ibm.com","username":"travis-mcpeak"},"change_message_id":"3b5d882cadd3a4e78a791056639b5c04337cbd66","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        machine_output[\u0027results\u0027] \u003d sorted(collector,"},{"line_number":77,"context_line":"                                           key\u003ditemgetter(\u0027filename\u0027))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    machine_output[\u0027metrics\u0027] \u003d metrics.metrics.metrics"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    # timezone agnostic format"},{"line_number":82,"context_line":"    TS_FORMAT \u003d \"%Y-%m-%dT%H:%M:%SZ\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_55d07f53","line":79,"updated":"2015-10-19 13:14:50.000000000","message":"how about we just \"from metrics import metrics as metrics\", then we can just use single \"metrics\u0027 everywhere?  metrics.metrics.metrics is a mouthful","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75187546f731b9e526a68e15f02149ade0e3cb4b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        machine_output[\u0027results\u0027] \u003d sorted(collector,"},{"line_number":77,"context_line":"                                           key\u003ditemgetter(\u0027filename\u0027))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    machine_output[\u0027metrics\u0027] \u003d metrics.metrics.metrics"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    # timezone agnostic format"},{"line_number":82,"context_line":"    TS_FORMAT \u003d \"%Y-%m-%dT%H:%M:%SZ\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_2dfa5743","line":79,"in_reply_to":"3a29b11f_35b943ea","updated":"2015-10-19 15:17:55.000000000","message":"More accurately, it is against hacking (not specifically PEP8)\n\nAlong the lines of my other review comment you could do:\n\n    machine_output[\u0027metrics\u0027] \u003d metrics.final_metrics()\n\nWhere you have\n\n    def final_metrics():\n        return metrics.metrics\n\nIn metrics.py","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"},{"author":{"_account_id":11716,"name":"Tim Kelsey","email":"timothy.kelsey@uk.ibm.com","username":"tkelsey"},"change_message_id":"86619593822dedc128ef6931581cabece552659c","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        machine_output[\u0027results\u0027] \u003d sorted(collector,"},{"line_number":77,"context_line":"                                           key\u003ditemgetter(\u0027filename\u0027))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    machine_output[\u0027metrics\u0027] \u003d metrics.metrics.metrics"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    # timezone agnostic format"},{"line_number":82,"context_line":"    TS_FORMAT \u003d \"%Y-%m-%dT%H:%M:%SZ\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_35b943ea","line":79,"in_reply_to":"3a29b11f_55d07f53","updated":"2015-10-19 13:16:51.000000000","message":"importing stuff that is not a module (i.e. a class) is against PEP8","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"}],"tests/functional/test_functional.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75187546f731b9e526a68e15f02149ade0e3cb4b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param expect: dict with expected values of metrics"},{"line_number":92,"context_line":"        \u0027\u0027\u0027"},{"line_number":93,"context_line":"        # reset scores and metrics for subsequent calls to run_example"},{"line_number":94,"context_line":"        metrics.metrics \u003d metrics.Metrics()"},{"line_number":95,"context_line":"        self.b_mgr.scores \u003d []"},{"line_number":96,"context_line":"        self.run_example(example_script)"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_cd63a319","line":94,"updated":"2015-10-19 15:17:55.000000000","message":"I don\u0027t quite like this, but I\u0027m not sure if we have a better way of sharing a single Metrics object. We should strive to figure out a better way to do this in the future than a module global/singleton that we replace as necessary.","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"}],"tests/unit/formatters/test_json.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75187546f731b9e526a68e15f02149ade0e3cb4b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.issue.test \u003d self.check_name"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.manager.results.append(self.issue)"},{"line_number":51,"context_line":"        metrics.metrics \u003d metrics.Metrics()"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def test_report(self):"},{"line_number":54,"context_line":"        self.manager.files_list \u003d [\u0027binding.py\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_4d5f9341","line":51,"updated":"2015-10-19 15:17:55.000000000","message":"We may want a separate module level function in the metrics like\n\n    def reset_metrics():\n        global metrics\n        metrics \u003d Metrics()","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"}],"tests/unit/formatters/test_text.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"75187546f731b9e526a68e15f02149ade0e3cb4b","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                                               self.context[\u0027lineno\u0027])"},{"line_number":81,"context_line":"            self.assertIn(expected, data)"},{"line_number":82,"context_line":"            expected \u003d \u0027Total lines of code: {0}\u0027.format("},{"line_number":83,"context_line":"                metrics.metrics.metrics[\u0027_totals\u0027][\u0027loc\u0027]"},{"line_number":84,"context_line":"            )"},{"line_number":85,"context_line":"            self.assertIn(expected, data)"},{"line_number":86,"context_line":"            expected \u003d \u0027Total lines skipped (#nosec): {0}\u0027.format("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_cd188387","line":83,"updated":"2015-10-19 15:17:55.000000000","message":"We\u0027re accessing these a lot. Why not make properties on the `Metrics` object like\n\n\n    @property\n    def total_loc(self):\n        self.metrics[\u0027_totals\u0027][\u0027loc\u0027]\n\n\n    @property\n    def total_nosec(self):\n        self.metrics[\u0027_totals\u0027][\u0027nosec\u0027]","commit_id":"f13f59e6ed50977c8681a405f5ea64f2f227bb9c"}]}
