)]}'
{"monasca_api/v2/reference/alarm_definitions.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"c1f960232af0f05661d4a6680d7198e41b8a235d","unresolved":false,"context_lines":[{"line_number":471,"context_line":"        if definitions:"},{"line_number":472,"context_line":"            LOG.warn(\"Found existing definition for {} with tenant_id {}\".format(name, tenant_id))"},{"line_number":473,"context_line":"            raise exceptions.AlreadyExistsException(\"An alarm definition with the name {} already exists\".format(name))"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        alarm_definition_id \u003d ("},{"line_number":476,"context_line":"            self._alarm_definitions_repo."},{"line_number":477,"context_line":"            create_alarm_definition(tenant_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_c6cf3e27","line":474,"updated":"2015-10-01 05:41:46.000000000","message":"Looks like this part and other change here are the same and are used to verify something, I\u0027d see that embedded in a module level function.","commit_id":"e311de4f34b6990fe7c9473a62c663654b54952b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"4f68230bc3219c7a031d384f860a88221af2fb1a","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        self._alarm_definition_delete(tenant_id, alarm_definition_id)"},{"line_number":212,"context_line":"        res.status \u003d falcon.HTTP_204"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def _find_existing_alarm_definition(self, tenant_id, name, expected_id\u003dNone):"},{"line_number":215,"context_line":"        definitions \u003d self._alarm_definitions_repo.get_alarm_definitions(tenant_id\u003dtenant_id,"},{"line_number":216,"context_line":"                                                                         name\u003dname,"},{"line_number":217,"context_line":"                                                                         dimensions\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_92625bac","line":214,"updated":"2015-10-20 19:41:02.000000000","message":"The name _find_existing_alarm_definition implies that this method is returning something. Instead, it should be named something like _validate_no_name_conflict","commit_id":"256add53195661e67f0bbb81f7d0d230af8475bb"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"91b60710c3ecef3c3be8ffe666703328546daa46","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                    .format(name, definitions[0][\u0027id\u0027]))"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        if definitions:"},{"line_number":230,"context_line":"            LOG.warn(\"Found existing definition for {} with tenant_id {}\".format(name, tenant_id))"},{"line_number":231,"context_line":"            raise exceptions.AlreadyExistsException(\"An alarm definition with the name {} already exists\".format(name))"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_39547951","line":229,"updated":"2015-10-21 09:02:00.000000000","message":"Minor nitpick; if this was \u0027elif definitions:\u0027 then you wouldn\u0027t need the \u0027return\u0027, and I think the flow of the method would be clearer...","commit_id":"f9c628a2bca42f4c8fe6590bcba0a4c306759556"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"5b9821e3a9dd82551d96e2d7db9772a34776938f","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                                                                         dimensions\u003dNone,"},{"line_number":218,"context_line":"                                                                         offset\u003dNone,"},{"line_number":219,"context_line":"                                                                         limit\u003d0)"},{"line_number":220,"context_line":"        if definitions and len(definitions) \u003e 0:"},{"line_number":221,"context_line":"            if not expected_id:"},{"line_number":222,"context_line":"                LOG.warn(\"Found existing definition for {} with tenant_id {}\".format(name, tenant_id))"},{"line_number":223,"context_line":"                raise exceptions.AlreadyExistsException(\"An alarm definition with the name {} already exists\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_f9f17d96","line":220,"updated":"2015-10-26 16:44:53.000000000","message":"I don\u0027t think you need the len(definitions) \u003e 0 part - in Python bool([]) \u003d\u003d bool(None) \u003d\u003d False","commit_id":"020c72db6a8790769c2b212ee2bb70e616084aff"}],"monasca_api/v2/reference/notifications.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"4f68230bc3219c7a031d384f860a88221af2fb1a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            LOG.debug(ex)"},{"line_number":52,"context_line":"            raise falcon.HTTPBadRequest(\u0027Bad request\u0027, ex.message)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _find_existing_notification(self, tenant_id, name, expected_id\u003dNone):"},{"line_number":55,"context_line":"        notification \u003d self._notifications_repo.find_notification_by_name(tenant_id, name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        if expected_id:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_32aca79f","line":54,"updated":"2015-10-20 19:41:02.000000000","message":"The name _find_existing_notification for this method implies it is returning something. Instead it is checking for a name conflict. It should be name appropriately to its function","commit_id":"256add53195661e67f0bbb81f7d0d230af8475bb"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"91b60710c3ecef3c3be8ffe666703328546daa46","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                    .format(name, notification[\u0027id\u0027]))"},{"line_number":64,"context_line":"            return"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        if notification:"},{"line_number":67,"context_line":"            LOG.warn(\"Found existing notification method for {} with tenant_id {}\".format(name, tenant_id))"},{"line_number":68,"context_line":"            raise exceptions.AlreadyExistsException("},{"line_number":69,"context_line":"                \"A notification method with the name {} already exists\".format(name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_99beed63","line":66,"updated":"2015-10-21 09:02:00.000000000","message":"as other note","commit_id":"f9c628a2bca42f4c8fe6590bcba0a4c306759556"},{"author":{"_account_id":15799,"name":"Ben Motz","email":"ben.launchpad@ouat.co.uk","username":"bmotz"},"change_message_id":"b0fb641c150fc2eefd73fdc64bce76a8fd78faa9","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    def _validate_name_not_conflicting(self, tenant_id, name, expected_id\u003dNone):"},{"line_number":55,"context_line":"        notification \u003d self._notifications_repo.find_notification_by_name(tenant_id, name)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        if expected_id and notification[\u0027id\u0027] !\u003d expected_id:"},{"line_number":58,"context_line":"            LOG.warn(\"Found existing notification method for {} with tenant_id {} with unexpected id {}\""},{"line_number":59,"context_line":"                     .format(name, tenant_id, notification[\u0027id\u0027]))"},{"line_number":60,"context_line":"            raise exceptions.AlreadyExistsException("}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_c314594e","line":57,"updated":"2015-10-21 16:37:16.000000000","message":"This will raise a TypeError if find_notification_by_name returns None","commit_id":"128983b7cd9378b420193a1fd1ae0a04e55795b6"}]}
