You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
5.6 KiB

  1. ===============
  2. Module Analysis
  3. ===============
  4. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. !! This file is generated by oca-gen-addon-readme !!
  6. !! changes will be overwritten. !!
  7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8. .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
  9. :target: https://odoo-community.org/page/development-status
  10. :alt: Beta
  11. .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  12. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  13. :alt: License: AGPL-3
  14. .. |badge3| image:: https://img.shields.io/badge/github-legalsylvain%2Fserver--tools-lightgray.png?logo=github
  15. :target: https://github.com/legalsylvain/server-tools/tree/12.0-ADD-module_analysis/module_analysis
  16. :alt: legalsylvain/server-tools
  17. |badge1| |badge2| |badge3|
  18. This module allows you to know 'how much code' is running on your Odoo
  19. instance, group by 'Type' (Odoo Core, OCA, other...)
  20. This module can be usefull in the following cases :
  21. * To analyse the size of your technical debt, regarding your Custom modules
  22. * To know the ratio between Odoo / OCA and Custom modules
  23. * To evaluate the amount to pay to odoo to upgrade your custom code, or the
  24. induced workload
  25. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/installed_modules_by_types.png
  26. For that purpose, it adds new concepts
  27. * ``ir.module.author``, based on the value ``author`` present in the manifest
  28. file.
  29. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/module_authors.png
  30. * ``ir.module.type``, populated by default with Odoo and OCA values.
  31. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/module_types.png
  32. Each installed modules have extra data in the 'Technical Data' tab :
  33. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/module_form.png
  34. **Table of contents**
  35. .. contents::
  36. :local:
  37. Installation
  38. ============
  39. To use this module, you have to install the ``pygount`` python librairy.
  40. ``pip install pygount``
  41. Configuration
  42. =============
  43. * Go to Apps / Module Analysis / Modules Types Rules
  44. The Module types Rules are usefull to get the Type of a module, based on
  45. it information.
  46. This module comes with default rules.
  47. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/default_module_type_rules.png
  48. You can add your custom rules to identify the modules your team have
  49. developped for exemple,
  50. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/add_module_type_rules.png
  51. to update the data, you have to :
  52. * Go to 'Apps' / 'Update Apps List'
  53. * Check the box 'Analyse Installed modules'
  54. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/base_module_update.png
  55. This will update analysis of your installed modules.
  56. Adding Extra data
  57. ~~~~~~~~~~~~~~~~~
  58. If you want to analyse other data, (for exemple, having the number of HTML
  59. files), create a custom modules and overload the module model :
  60. .. code-block:: python
  61. from odoo import api, fields, models
  62. class IrModuleModule(models.Model):
  63. _inherit = 'ir.module.module'
  64. xml_documentation_qty = fields.Integer(
  65. string='Quantity of Comments in XML Files')
  66. @api.model
  67. def _get_analyse_settings(self):
  68. res = super()._get_analyse_settings()
  69. if not '.html' in res:
  70. res['.html'] = {}
  71. res['.html']['documentation'] 'xml_documentation_qty'
  72. return res
  73. Exclude files and directories
  74. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  75. Two parameters are availaible in 'Settings' / 'Technical' / 'Parameters'
  76. 'System Parameters' :
  77. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/config_parameters.png
  78. The list of folders and filename will be exclude from the analysis.
  79. You can change the default settings.
  80. Usage
  81. =====
  82. * Go to 'Apps' / 'Module Analysis' / 'Installed module by Types'
  83. Open the stats to analyse the detail of the code installed
  84. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/analysis_pivot.png
  85. .. image:: https://raw.githubusercontent.com/legalsylvain/server-tools/12.0-ADD-module_analysis/module_analysis/static/description/analysis_pie.png
  86. Bug Tracker
  87. ===========
  88. Bugs are tracked on `GitHub Issues <https://github.com/legalsylvain/server-tools/issues>`_.
  89. In case of trouble, please check there if your issue has already been reported.
  90. If you spotted it first, help us smashing it by providing a detailed and welcomed
  91. `feedback <https://github.com/legalsylvain/server-tools/issues/new?body=module:%20module_analysis%0Aversion:%2012.0-ADD-module_analysis%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  92. Do not contact contributors directly about support or help with technical issues.
  93. Credits
  94. =======
  95. Authors
  96. ~~~~~~~
  97. * GRAP
  98. Contributors
  99. ~~~~~~~~~~~~
  100. * Sylvain LE GAL (https://twitter.com/legalsylvain)
  101. Maintainers
  102. ~~~~~~~~~~~
  103. This module is part of the `legalsylvain/server-tools <https://github.com/legalsylvain/server-tools/tree/12.0-ADD-module_analysis/module_analysis>`_ project on GitHub.
  104. You are welcome to contribute.