{ "info": { "author": "Michal Wachowski", "author_email": "wachowski.michal@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "===========================\nLack of cohesion of methods\n===========================\n\nCohesion metrics measure how well methods of a class are related to each other.\nA cohesive class has one responsibility. A non-cohesive class has more\nunrelated functions, thus more than one responsibility.\n\n**LCOM4** considers method as related with other method, when both of them use common attribute or method call.\nMethods are not compared with constructors / initializers eg. ``__init__``, since they often involve all attributes.\nAlso all inherited methods are ignored - as they come from different class.\n\nScore:\n\n- ``==1`` - indicates a cohesive class, which is the \"good\" class;\n- ``>=2`` - indicates a problem. The class should be split into so many smaller classes;\n- ``==0`` - happens when there are no methods in a class. This is also a \"bad\" class.\n\nUsage\n=====\n\nJust point it to a module or a package that needs to be measured:\n\n.. code-block:: cli\n\n\tbin/lcom src\n\nThis will result in such output:\n\n.. code-block:: cli\n\n\tCalculating LCOM using LCOM4\n\t+---------------------------------+------+\n\t| Method | LCOM |\n\t+---------------------------------+------+\n\t| src.command.FileSystem | 1 |\n\t| src.command.LCOMFactory | 0 |\n\t| src.command.Printer | 0 |\n\t| src.command.PrinterFactory | 0 |\n\t| src.command.Runner | 1 |\n\t| src.command.STDOut | 0 |\n\t| src.lcom.LCOM4 | 1 |\n\t| src.lcom.LCOMAlgorithm | 0 |\n\t| src.reflection.ClassReflection | 1 |\n\t| src.reflection.MethodReflection | 1 |\n\t| src.reflection.ModuleReflection | 1 |\n\t| src.reflection.Reflection | 0 |\n\t| src.reflection.ReflectionError | 0 |\n\t+---------------------------------+------+\n\t| Average | 0.46 |\n\t+---------------------------------+------+\n\n\nIt is also possible to measure single module:\n\n\n.. code-block:: cli\n\n\tbin/lcom src/command.py\n\nOr mix them:\n\n.. code-block:: cli\n\n\tbin/lcom src/command.py tests\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/potfur/lcom/archive/0.1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/potfur/lcom", "keywords": "cohesion", "license": "", "maintainer": "", "maintainer_email": "", "name": "lcom", "package_url": "https://pypi.org/project/lcom/", "platform": "", "project_url": "https://pypi.org/project/lcom/", "project_urls": { "Download": "https://github.com/potfur/lcom/archive/0.1.0.tar.gz", "Homepage": "https://github.com/potfur/lcom" }, "release_url": "https://pypi.org/project/lcom/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Lack of cohesion of methods metric", "version": "0.1.0" }, "last_serial": 3273099, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "858944cb5da2ca2915af3b7c97a409a2", "sha256": "85f7e893b100f1d8e9f8cd6c5689c46d4cac49452551b3475e68a8f1ae22321d" }, "downloads": -1, "filename": "lcom-0.1.0.tar.gz", "has_sig": false, "md5_digest": "858944cb5da2ca2915af3b7c97a409a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4858, "upload_time": "2017-10-23T19:34:33", "url": "https://files.pythonhosted.org/packages/ea/9d/f7516ee8e86921c2c0276d4c1ddce425234258ab91628c7cf38ce5c43e8d/lcom-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "858944cb5da2ca2915af3b7c97a409a2", "sha256": "85f7e893b100f1d8e9f8cd6c5689c46d4cac49452551b3475e68a8f1ae22321d" }, "downloads": -1, "filename": "lcom-0.1.0.tar.gz", "has_sig": false, "md5_digest": "858944cb5da2ca2915af3b7c97a409a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4858, "upload_time": "2017-10-23T19:34:33", "url": "https://files.pythonhosted.org/packages/ea/9d/f7516ee8e86921c2c0276d4c1ddce425234258ab91628c7cf38ce5c43e8d/lcom-0.1.0.tar.gz" } ] }