From 0e7bf9a4801541bd708d0d5ca619f938ed5fc230 Mon Sep 17 00:00:00 2001 From: Mantouisyummy Date: Mon, 25 Mar 2024 06:53:31 +0000 Subject: [PATCH] deploy: 26e63a7239046ef72567941701142273380fe633 --- .../projectStructure/ProjectFingerprint.json | 3 +- .../projectStructure/SDKs.json | 159 +- results/descriptions/Code_Inspection.json | 54 +- results/metaInformation.json | 8 +- .../projectStructure/ProjectFingerprint.json | 3 +- results/projectStructure/SDKs.json | 159 +- results/qodana.sarif.json | 2517 +++++++++++------ results/result-allProblems.json | 733 ++++- results/sanity.json | 594 +--- 9 files changed, 2845 insertions(+), 1385 deletions(-) diff --git a/results/Code_Inspection/projectStructure/ProjectFingerprint.json b/results/Code_Inspection/projectStructure/ProjectFingerprint.json index 33f110ca..46a3de1e 100644 --- a/results/Code_Inspection/projectStructure/ProjectFingerprint.json +++ b/results/Code_Inspection/projectStructure/ProjectFingerprint.json @@ -1,13 +1,12 @@ { "languages": [ "Python", - "XML", - ".gitignore (GitIgnore)", "Plain text", "Shell Script", "JSON", "YAML", "textmate", + ".gitignore (GitIgnore)", "Requirements" ] } \ No newline at end of file diff --git a/results/Code_Inspection/projectStructure/SDKs.json b/results/Code_Inspection/projectStructure/SDKs.json index a18d2176..20067c38 100644 --- a/results/Code_Inspection/projectStructure/SDKs.json +++ b/results/Code_Inspection/projectStructure/SDKs.json @@ -2,7 +2,164 @@ "sdks": [ { "name": "Python 3.11", - "roots": [] + "roots": [ + "file:///opt/miniconda3/lib/python3.11", + "file:///opt/miniconda3/lib/python3.11/lib-dynload", + "file:///opt/miniconda3/lib/python3.11/site-packages", + "file://$PROJECT_DIR$/../cache/idea/233/python_stubs/-2066100795", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/python-skeletons", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stdlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/gdb", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/six", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/boto", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/cffi", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mock", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pika", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pytz", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/toml", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tqdm", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/zstd", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/WebOb", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/first", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/fpdf2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ldap3", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/polib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyjks", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/redis", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/regex", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/retry", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/uWSGI", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ujson", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Pillow", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyYAML", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/bleach", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/caldav", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/docopt", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/hdbcli", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ibm-db", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/invoke", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/passpy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/peewee", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pluggy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/psutil", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyasn1", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pycurl", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pynput", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pysftp", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/qrcode", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/stripe", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/zxcvbn", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyMySQL", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/WTForms", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/boltons", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/chevron", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/inifile", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/libsass", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/netaddr", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/passlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pexpect", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyaudio", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyvmomi", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pywin32", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/slumber", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tzlocal", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/vobject", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ExifRead", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Markdown", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Pygments", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/aiofiles", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/colorama", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/croniter", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/docutils", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/greenlet", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/html5lib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/httplib2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/jmespath", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/keyboard", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/oauthlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/openpyxl", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/paramiko", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/psycopg2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyflakes", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyserial", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/requests", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tabulate", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/toposort", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/untangle", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/waitress", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyAutoGUI", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyScreeze", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/braintree", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/decorator", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/paho-mqtt", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/playsound", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyOpenSSL", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyRFC3339", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ttkthemes", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/xmltodict", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Deprecated", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-Cors", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/SQLAlchemy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Send2Trash", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/cachetools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/commonmark", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/dateparser", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/jsonschema", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyfarmhash", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/setuptools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/simplejson", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tensorflow", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/JACK-Client", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/entrypoints", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-2020", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mysqlclient", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/opentracing", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pep8-naming", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pycocotools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyinstaller", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-jose", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-nmap", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-xlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/stdlib-list", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tree-sitter", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/workalendar", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/aws-xray-sdk", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/console-menu", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/editdistance", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/parsimonious", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/usersettings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/whatthepatch", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-Migrate", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/click-spinner", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/humanfriendly", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-gflags", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-SocketIO", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/beautifulsoup4", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-bugbear", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-crontab", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-slugify", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/singledispatch", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-builtins", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-simplify", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/influxdb-client", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mypy-extensions", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-datemath", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-dateutil", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-SQLAlchemy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/dockerfile-parse", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/s2clientprotocol", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-docstrings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/requests-oauthlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/translationstring", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/click-default-group", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-plugin-utils", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pytest-lazy-fixture", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-rst-docstrings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-typing-imports", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tree-sitter-languages" + ], + "sdkType": "Python SDK", + "sdkVersion": "Python 3.11.5" } ] } \ No newline at end of file diff --git a/results/descriptions/Code_Inspection.json b/results/descriptions/Code_Inspection.json index 9180589a..b5444d82 100644 --- a/results/descriptions/Code_Inspection.json +++ b/results/descriptions/Code_Inspection.json @@ -291,18 +291,18 @@ "enabled": true, "description": "Reports equality comparison with a boolean literal.\n\n**Example:**\n\n\n def func(s):\n if s.isdigit() == True:\n return int(s)\n\nWith the quick-fix applied, the code fragment will be simplified to:\n\n\n def func(s):\n if s.isdigit():\n return int(s)\n" }, - { - "shortName": "PyMethodOverridingInspection", - "displayName": "Method signature does not match signature of overridden method", - "enabled": true, - "description": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." - }, { "shortName": "PoetryPackageVersionsInspection", "displayName": "Poetry package versions", "enabled": true, "description": "Reports outdated versions of packages in `[tool.poetry.dependencies]` and `[tool.poetry.dev-dependencies]`\nsections of `pyproject.toml`." }, + { + "shortName": "PyMethodOverridingInspection", + "displayName": "Method signature does not match signature of overridden method", + "enabled": true, + "description": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." + }, { "shortName": "PyTestParametrizedInspection", "displayName": "Incorrect arguments in @pytest.mark.parametrize", @@ -321,18 +321,18 @@ "enabled": true, "description": "Reports coroutines that were called\nwithout using the `await` syntax.\n\n**Example:**\n\n\n async def bar():\n pass\n\n\n async def foo():\n bar()\n\nAfter the quick-fix is applied, the code changes to:\n\n\n async def bar():\n pass\n\n\n async def foo():\n await bar()\n" }, - { - "shortName": "CommandLineInspection", - "displayName": "Incorrect CLI syntax", - "enabled": true, - "description": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." - }, { "shortName": "PyComparisonWithNoneInspection", "displayName": "Using equality operators to compare with None", "enabled": true, "description": "Reports comparisons with `None`. That type of comparisons\nshould always be done with `is` or `is not`, never\nthe equality operators.\n\n**Example:**\n\n\n a = 2\n\n\n if a == None:\n print(\"Success\")\n\nOnce the quick-fix is applied, the code changes to:\n\n\n a = 2\n\n\n if a is None:\n print(\"Success\")\n" }, + { + "shortName": "CommandLineInspection", + "displayName": "Incorrect CLI syntax", + "enabled": true, + "description": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." + }, { "shortName": "PyCallingNonCallableInspection", "displayName": "Attempt to call a non-callable object", @@ -345,18 +345,18 @@ "enabled": true, "description": "Reports code fragments that cannot be normally reached.\n\n**Example:**\n\n\n if True:\n print('Yes')\n else:\n print('No')\n\nAs a fix, you might want to check and modify the algorithm to ensure it implements\nthe expected logic." }, - { - "shortName": "PyChainedComparisonsInspection", - "displayName": "Too complex chained comparisons", - "enabled": true, - "description": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" - }, { "shortName": "PyMethodParametersInspection", "displayName": "Improper first parameter", "enabled": true, "description": "Reports methods that lack the first parameter that is usually\nnamed `self`.\n\n**Example:**\n\n\n class Movie:\n\n def show():\n pass\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Movie:\n\n def show(self):\n pass\n\nThe inspection also reports naming issues in class methods.\n\n**Example:**\n\n\n class Movie:\n @classmethod\n def show(abc):\n pass\n\nSince the first parameter of a class method should be `cls`, the IDE provides a quick-fix\nto rename it." }, + { + "shortName": "PyChainedComparisonsInspection", + "displayName": "Too complex chained comparisons", + "enabled": true, + "description": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" + }, { "shortName": "PyDocstringTypesInspection", "displayName": "Type in docstring does not match inferred type", @@ -483,12 +483,6 @@ "enabled": true, "description": "Reports cases in Python 2 when a file contains non-ASCII characters and does not\nhave an encoding declaration at the top.\n\n**Example:**\n\n\n class A(object):\n # №5\n def __init__(self):\n pass\n\nIn this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding\ndeclaration. Apply the proposed quick-fix to add a missing encoding declaration:\n\n\n # coding=utf-8\n class A(object)\n # №5\n def __init__(self):\n pass\n" }, - { - "shortName": "PyRedundantParenthesesInspection", - "displayName": "Redundant parentheses", - "enabled": true, - "description": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." - }, { "shortName": "PyTrailingSemicolonInspection", "displayName": "Prohibited trailing semicolon in a statement", @@ -496,10 +490,10 @@ "description": "Reports trailing semicolons in statements.\n\n**Example:**\n\n\n def my_func(a):\n c = a ** 2;\n return c\n\nIDE provides a quick-fix that removes a trailing semicolon. When you\napply it, the code changes to:\n\n\n def my_func(a):\n c = a ** 2\n return c\n" }, { - "shortName": "PyAbstractClassInspection", - "displayName": "Class must implement all abstract methods", + "shortName": "PyRedundantParenthesesInspection", + "displayName": "Redundant parentheses", "enabled": true, - "description": "Reports cases when not all abstract properties or methods are defined in\na subclass.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_triangle(self):\n pass\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n" + "description": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." }, { "shortName": "PyOldStyleClassesInspection", @@ -507,6 +501,12 @@ "enabled": true, "description": "Reports occurrences of\n[new-style class features](https://www.python.org/doc/newstyle/)\nin old-style classes. The inspection highlights\n`__slots__`, `__getattribute__`, and `super()`\ninside old-style classes." }, + { + "shortName": "PyAbstractClassInspection", + "displayName": "Class must implement all abstract methods", + "enabled": true, + "description": "Reports cases when not all abstract properties or methods are defined in\na subclass.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_triangle(self):\n pass\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n" + }, { "shortName": "PyArgumentListInspection", "displayName": "Incorrect call arguments", diff --git a/results/metaInformation.json b/results/metaInformation.json index c8377e4e..483cdd10 100644 --- a/results/metaInformation.json +++ b/results/metaInformation.json @@ -1,7 +1,7 @@ { - "total": 8, + "total": 31, "tools inspection": { - "Code Inspection": 8 + "Code Inspection": 31 }, "linter": "QDPYC", "attributes": { @@ -9,11 +9,11 @@ "sarifIdea": { "repositoryUri": "https://github.com/Nat1anWasTaken/Lava.git", "revisionId": "26e63a7239046ef72567941701142273380fe633", - "branch": "refs/heads/master" + "branch": "refs/heads/105-feat-playlist-support" } }, "deviceId": "200820300000000-f46c-a99e-6401-ff7b7532c766", - "jobUrl": "https://github.com/Nat1anWasTaken/Lava/actions/runs/8409956980", + "jobUrl": "https://github.com/Nat1anWasTaken/Lava/actions/runs/8416182239", "repoUrl": "https://github.com/Nat1anWasTaken/Lava.git" } } \ No newline at end of file diff --git a/results/projectStructure/ProjectFingerprint.json b/results/projectStructure/ProjectFingerprint.json index 33f110ca..46a3de1e 100644 --- a/results/projectStructure/ProjectFingerprint.json +++ b/results/projectStructure/ProjectFingerprint.json @@ -1,13 +1,12 @@ { "languages": [ "Python", - "XML", - ".gitignore (GitIgnore)", "Plain text", "Shell Script", "JSON", "YAML", "textmate", + ".gitignore (GitIgnore)", "Requirements" ] } \ No newline at end of file diff --git a/results/projectStructure/SDKs.json b/results/projectStructure/SDKs.json index a18d2176..20067c38 100644 --- a/results/projectStructure/SDKs.json +++ b/results/projectStructure/SDKs.json @@ -2,7 +2,164 @@ "sdks": [ { "name": "Python 3.11", - "roots": [] + "roots": [ + "file:///opt/miniconda3/lib/python3.11", + "file:///opt/miniconda3/lib/python3.11/lib-dynload", + "file:///opt/miniconda3/lib/python3.11/site-packages", + "file://$PROJECT_DIR$/../cache/idea/233/python_stubs/-2066100795", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/python-skeletons", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stdlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/gdb", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/six", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/boto", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/cffi", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mock", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pika", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pytz", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/toml", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tqdm", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/zstd", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/WebOb", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/first", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/fpdf2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ldap3", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/polib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyjks", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/redis", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/regex", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/retry", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/uWSGI", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ujson", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Pillow", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyYAML", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/bleach", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/caldav", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/docopt", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/hdbcli", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ibm-db", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/invoke", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/passpy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/peewee", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pluggy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/psutil", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyasn1", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pycurl", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pynput", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pysftp", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/qrcode", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/stripe", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/zxcvbn", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyMySQL", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/WTForms", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/boltons", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/chevron", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/inifile", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/libsass", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/netaddr", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/passlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pexpect", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyaudio", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyvmomi", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pywin32", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/slumber", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tzlocal", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/vobject", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ExifRead", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Markdown", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Pygments", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/aiofiles", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/colorama", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/croniter", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/docutils", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/greenlet", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/html5lib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/httplib2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/jmespath", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/keyboard", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/oauthlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/openpyxl", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/paramiko", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/psycopg2", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyflakes", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyserial", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/requests", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tabulate", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/toposort", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/untangle", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/waitress", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyAutoGUI", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/PyScreeze", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/braintree", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/decorator", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/paho-mqtt", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/playsound", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyOpenSSL", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyRFC3339", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/ttkthemes", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/xmltodict", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Deprecated", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-Cors", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/SQLAlchemy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Send2Trash", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/cachetools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/commonmark", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/dateparser", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/jsonschema", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyfarmhash", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/setuptools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/simplejson", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tensorflow", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/JACK-Client", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/entrypoints", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-2020", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mysqlclient", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/opentracing", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pep8-naming", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pycocotools", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pyinstaller", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-jose", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-nmap", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-xlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/stdlib-list", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tree-sitter", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/workalendar", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/aws-xray-sdk", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/console-menu", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/editdistance", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/parsimonious", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/usersettings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/whatthepatch", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-Migrate", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/click-spinner", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/humanfriendly", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-gflags", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-SocketIO", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/beautifulsoup4", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-bugbear", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-crontab", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-slugify", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/singledispatch", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-builtins", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-simplify", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/influxdb-client", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/mypy-extensions", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-datemath", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/python-dateutil", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/Flask-SQLAlchemy", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/dockerfile-parse", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/s2clientprotocol", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-docstrings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/requests-oauthlib", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/translationstring", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/click-default-group", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-plugin-utils", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/pytest-lazy-fixture", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-rst-docstrings", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/flake8-typing-imports", + "file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/typeshed/stubs/tree-sitter-languages" + ], + "sdkType": "Python SDK", + "sdkVersion": "Python 3.11.5" } ] } \ No newline at end of file diff --git a/results/qodana.sarif.json b/results/qodana.sarif.json index 99954b5d..6ee5b2b0 100644 --- a/results/qodana.sarif.json +++ b/results/qodana.sarif.json @@ -1651,19 +1651,19 @@ ] }, { - "id": "PyMethodOverridingInspection", + "id": "PoetryPackageVersionsInspection", "shortDescription": { - "text": "Method signature does not match signature of overridden method" + "text": "Poetry package versions" }, "fullDescription": { - "text": "Reports inconsistencies in overriding method signatures. Example: 'class Book:\n def add_title(self):\n pass\n\n\nclass Novel(Book):\n def add_title(self, text):\n pass' Parameters of the 'add_title' method in the 'Novel' class do not match the method signature specified in the 'Book' class. As a fix, the IDE offers to apply the Change Signature refactoring.", - "markdown": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." + "text": "Reports outdated versions of packages in '[tool.poetry.dependencies]' and '[tool.poetry.dev-dependencies]' sections of 'pyproject.toml'.", + "markdown": "Reports outdated versions of packages in `[tool.poetry.dependencies]` and `[tool.poetry.dev-dependencies]`\nsections of `pyproject.toml`." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "PyMethodOverriding", + "suppressToolId": "PoetryPackageVersions", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -1684,19 +1684,19 @@ ] }, { - "id": "PoetryPackageVersionsInspection", + "id": "PyMethodOverridingInspection", "shortDescription": { - "text": "Poetry package versions" + "text": "Method signature does not match signature of overridden method" }, "fullDescription": { - "text": "Reports outdated versions of packages in '[tool.poetry.dependencies]' and '[tool.poetry.dev-dependencies]' sections of 'pyproject.toml'.", - "markdown": "Reports outdated versions of packages in `[tool.poetry.dependencies]` and `[tool.poetry.dev-dependencies]`\nsections of `pyproject.toml`." + "text": "Reports inconsistencies in overriding method signatures. Example: 'class Book:\n def add_title(self):\n pass\n\n\nclass Novel(Book):\n def add_title(self, text):\n pass' Parameters of the 'add_title' method in the 'Novel' class do not match the method signature specified in the 'Book' class. As a fix, the IDE offers to apply the Change Signature refactoring.", + "markdown": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." }, "defaultConfiguration": { "enabled": true, "level": "warning", "parameters": { - "suppressToolId": "PoetryPackageVersions", + "suppressToolId": "PyMethodOverriding", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -1816,21 +1816,21 @@ ] }, { - "id": "CommandLineInspection", + "id": "PyComparisonWithNoneInspection", "shortDescription": { - "text": "Incorrect CLI syntax" + "text": "Using equality operators to compare with None" }, "fullDescription": { - "text": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies that option names and arguments are correct. Do not disable the inspection if you are going to use command-line interfaces like manage.py in Django.", - "markdown": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." + "text": "Reports comparisons with 'None'. That type of comparisons should always be done with 'is' or 'is not', never the equality operators. Example: 'a = 2\n\n\nif a == None:\n print(\"Success\")' Once the quick-fix is applied, the code changes to: 'a = 2\n\n\nif a is None:\n print(\"Success\")'", + "markdown": "Reports comparisons with `None`. That type of comparisons\nshould always be done with `is` or `is not`, never\nthe equality operators.\n\n**Example:**\n\n\n a = 2\n\n\n if a == None:\n print(\"Success\")\n\nOnce the quick-fix is applied, the code changes to:\n\n\n a = 2\n\n\n if a is None:\n print(\"Success\")\n" }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "CommandLineInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PyComparisonWithNone", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -1849,21 +1849,21 @@ ] }, { - "id": "PyComparisonWithNoneInspection", + "id": "CommandLineInspection", "shortDescription": { - "text": "Using equality operators to compare with None" + "text": "Incorrect CLI syntax" }, "fullDescription": { - "text": "Reports comparisons with 'None'. That type of comparisons should always be done with 'is' or 'is not', never the equality operators. Example: 'a = 2\n\n\nif a == None:\n print(\"Success\")' Once the quick-fix is applied, the code changes to: 'a = 2\n\n\nif a is None:\n print(\"Success\")'", - "markdown": "Reports comparisons with `None`. That type of comparisons\nshould always be done with `is` or `is not`, never\nthe equality operators.\n\n**Example:**\n\n\n a = 2\n\n\n if a == None:\n print(\"Success\")\n\nOnce the quick-fix is applied, the code changes to:\n\n\n a = 2\n\n\n if a is None:\n print(\"Success\")\n" + "text": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies that option names and arguments are correct. Do not disable the inspection if you are going to use command-line interfaces like manage.py in Django.", + "markdown": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "PyComparisonWithNone", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "CommandLineInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ @@ -1948,19 +1948,19 @@ ] }, { - "id": "PyChainedComparisonsInspection", + "id": "PyMethodParametersInspection", "shortDescription": { - "text": "Too complex chained comparisons" + "text": "Improper first parameter" }, "fullDescription": { - "text": "Reports chained comparisons that can be simplified. Example: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass' The IDE offers to simplify 'if x >= xmin and x <= xmax'. When the quick-fix is applied, the code changes to: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass'", - "markdown": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" + "text": "Reports methods that lack the first parameter that is usually named 'self'. Example: 'class Movie:\n\n def show():\n pass' When the quick-fix is applied, the code changes to: 'class Movie:\n\n def show(self):\n pass' The inspection also reports naming issues in class methods. Example: 'class Movie:\n @classmethod\n def show(abc):\n pass' Since the first parameter of a class method should be 'cls', the IDE provides a quick-fix to rename it.", + "markdown": "Reports methods that lack the first parameter that is usually\nnamed `self`.\n\n**Example:**\n\n\n class Movie:\n\n def show():\n pass\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Movie:\n\n def show(self):\n pass\n\nThe inspection also reports naming issues in class methods.\n\n**Example:**\n\n\n class Movie:\n @classmethod\n def show(abc):\n pass\n\nSince the first parameter of a class method should be `cls`, the IDE provides a quick-fix\nto rename it." }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "PyChainedComparisons", + "suppressToolId": "PyMethodParameters", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -1981,19 +1981,19 @@ ] }, { - "id": "PyMethodParametersInspection", + "id": "PyChainedComparisonsInspection", "shortDescription": { - "text": "Improper first parameter" + "text": "Too complex chained comparisons" }, "fullDescription": { - "text": "Reports methods that lack the first parameter that is usually named 'self'. Example: 'class Movie:\n\n def show():\n pass' When the quick-fix is applied, the code changes to: 'class Movie:\n\n def show(self):\n pass' The inspection also reports naming issues in class methods. Example: 'class Movie:\n @classmethod\n def show(abc):\n pass' Since the first parameter of a class method should be 'cls', the IDE provides a quick-fix to rename it.", - "markdown": "Reports methods that lack the first parameter that is usually\nnamed `self`.\n\n**Example:**\n\n\n class Movie:\n\n def show():\n pass\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Movie:\n\n def show(self):\n pass\n\nThe inspection also reports naming issues in class methods.\n\n**Example:**\n\n\n class Movie:\n @classmethod\n def show(abc):\n pass\n\nSince the first parameter of a class method should be `cls`, the IDE provides a quick-fix\nto rename it." + "text": "Reports chained comparisons that can be simplified. Example: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass' The IDE offers to simplify 'if x >= xmin and x <= xmax'. When the quick-fix is applied, the code changes to: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass'", + "markdown": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" }, "defaultConfiguration": { "enabled": true, "level": "note", "parameters": { - "suppressToolId": "PyMethodParameters", + "suppressToolId": "PyChainedComparisons", "ideaSeverity": "WEAK WARNING", "qodanaSeverity": "Moderate" } @@ -2707,21 +2707,21 @@ ] }, { - "id": "PyRedundantParenthesesInspection", + "id": "PyTrailingSemicolonInspection", "shortDescription": { - "text": "Redundant parentheses" + "text": "Prohibited trailing semicolon in a statement" }, "fullDescription": { - "text": "Reports about redundant parentheses in expressions. The IDE provides the quick-fix action to remove the redundant parentheses.", - "markdown": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." + "text": "Reports trailing semicolons in statements. Example: 'def my_func(a):\n c = a ** 2;\n return c' IDE provides a quick-fix that removes a trailing semicolon. When you apply it, the code changes to: 'def my_func(a):\n c = a ** 2\n return c'", + "markdown": "Reports trailing semicolons in statements.\n\n**Example:**\n\n\n def my_func(a):\n c = a ** 2;\n return c\n\nIDE provides a quick-fix that removes a trailing semicolon. When you\napply it, the code changes to:\n\n\n def my_func(a):\n c = a ** 2\n return c\n" }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "PyRedundantParentheses", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "PyTrailingSemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ @@ -2740,21 +2740,21 @@ ] }, { - "id": "PyTrailingSemicolonInspection", + "id": "PyRedundantParenthesesInspection", "shortDescription": { - "text": "Prohibited trailing semicolon in a statement" + "text": "Redundant parentheses" }, "fullDescription": { - "text": "Reports trailing semicolons in statements. Example: 'def my_func(a):\n c = a ** 2;\n return c' IDE provides a quick-fix that removes a trailing semicolon. When you apply it, the code changes to: 'def my_func(a):\n c = a ** 2\n return c'", - "markdown": "Reports trailing semicolons in statements.\n\n**Example:**\n\n\n def my_func(a):\n c = a ** 2;\n return c\n\nIDE provides a quick-fix that removes a trailing semicolon. When you\napply it, the code changes to:\n\n\n def my_func(a):\n c = a ** 2\n return c\n" + "text": "Reports about redundant parentheses in expressions. The IDE provides the quick-fix action to remove the redundant parentheses.", + "markdown": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "PyTrailingSemicolon", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PyRedundantParentheses", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -2773,21 +2773,21 @@ ] }, { - "id": "PyAbstractClassInspection", + "id": "PyOldStyleClassesInspection", "shortDescription": { - "text": "Class must implement all abstract methods" + "text": "Old-style class contains new-style class features" }, "fullDescription": { - "text": "Reports cases when not all abstract properties or methods are defined in a subclass. Example: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_triangle(self):\n pass' When the quick-fix is applied, the IDE implements an abstract method for the 'Triangle' class: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass'", - "markdown": "Reports cases when not all abstract properties or methods are defined in\na subclass.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_triangle(self):\n pass\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n" + "text": "Reports occurrences of new-style class features in old-style classes. The inspection highlights '__slots__', '__getattribute__', and 'super()' inside old-style classes.", + "markdown": "Reports occurrences of\n[new-style class features](https://www.python.org/doc/newstyle/)\nin old-style classes. The inspection highlights\n`__slots__`, `__getattribute__`, and `super()`\ninside old-style classes." }, "defaultConfiguration": { "enabled": true, - "level": "note", + "level": "warning", "parameters": { - "suppressToolId": "PyAbstractClass", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate" + "suppressToolId": "PyOldStyleClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High" } }, "relationships": [ @@ -2806,21 +2806,21 @@ ] }, { - "id": "PyOldStyleClassesInspection", + "id": "PyAbstractClassInspection", "shortDescription": { - "text": "Old-style class contains new-style class features" + "text": "Class must implement all abstract methods" }, "fullDescription": { - "text": "Reports occurrences of new-style class features in old-style classes. The inspection highlights '__slots__', '__getattribute__', and 'super()' inside old-style classes.", - "markdown": "Reports occurrences of\n[new-style class features](https://www.python.org/doc/newstyle/)\nin old-style classes. The inspection highlights\n`__slots__`, `__getattribute__`, and `super()`\ninside old-style classes." + "text": "Reports cases when not all abstract properties or methods are defined in a subclass. Example: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_triangle(self):\n pass' When the quick-fix is applied, the IDE implements an abstract method for the 'Triangle' class: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass'", + "markdown": "Reports cases when not all abstract properties or methods are defined in\na subclass.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_triangle(self):\n pass\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n" }, "defaultConfiguration": { "enabled": true, - "level": "warning", + "level": "note", "parameters": { - "suppressToolId": "PyOldStyleClasses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "suppressToolId": "PyAbstractClass", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate" } }, "relationships": [ @@ -5404,19 +5404,19 @@ ] }, { - "id": "UnusedDefine", + "id": "HtmlUnknownAnchorTarget", "shortDescription": { - "text": "Unused define" + "text": "Unresolved fragment in a link" }, "fullDescription": { - "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored.", - "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored." + "text": "Reports an unresolved last part of an URL after the '#' sign.", + "markdown": "Reports an unresolved last part of an URL after the `#` sign." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "UnusedDefine", + "suppressToolId": "HtmlUnknownAnchorTarget", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5424,8 +5424,8 @@ "relationships": [ { "target": { - "id": "RELAX NG", - "index": 11, + "id": "HTML", + "index": 8, "toolComponent": { "name": "QDPYC" } @@ -5437,19 +5437,19 @@ ] }, { - "id": "HtmlUnknownAnchorTarget", + "id": "UnusedDefine", "shortDescription": { - "text": "Unresolved fragment in a link" + "text": "Unused define" }, "fullDescription": { - "text": "Reports an unresolved last part of an URL after the '#' sign.", - "markdown": "Reports an unresolved last part of an URL after the `#` sign." + "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored.", + "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored." }, "defaultConfiguration": { "enabled": false, "level": "warning", "parameters": { - "suppressToolId": "HtmlUnknownAnchorTarget", + "suppressToolId": "UnusedDefine", "ideaSeverity": "WARNING", "qodanaSeverity": "High" } @@ -5457,8 +5457,8 @@ "relationships": [ { "target": { - "id": "HTML", - "index": 8, + "id": "RELAX NG", + "index": 11, "toolComponent": { "name": "QDPYC" } @@ -6675,7 +6675,7 @@ }, "invocations": [ { - "startTimeUtc": "2024-03-24T14:20:42.887179039Z", + "startTimeUtc": "2024-03-25T06:52:52.460096746Z", "exitCode": 0, "toolExecutionNotifications": [ { @@ -6683,7 +6683,7 @@ "text": "Analysis by sanity inspection \"Unresolved references\" was suspended due to high number of problems." }, "level": "error", - "timeUtc": "2024-03-24T14:20:49.011271227Z", + "timeUtc": "2024-03-25T06:53:21.488011529Z", "properties": { "qodanaKind": "sanityFailure" } @@ -6697,7 +6697,7 @@ { "repositoryUri": "https://github.com/Nat1anWasTaken/Lava.git", "revisionId": "26e63a7239046ef72567941701142273380fe633", - "branch": "refs/heads/master", + "branch": "refs/heads/105-feat-playlist-support", "properties": { "repoUrl": "https://github.com/Nat1anWasTaken/Lava.git", "lastAuthorName": "wolf-yuan", @@ -6763,27 +6763,27 @@ } }, { - "ruleId": "PyClassHasNoInitInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", - "level": "note", + "level": "warning", "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/variables.py", + "uri": "lava/utils.py", "uriBaseId": "SRCROOT" }, "region": { "startLine": 1, - "startColumn": 7, - "charOffset": 6, - "charLength": 9, + "startColumn": 1, + "charOffset": 0, + "charLength": 77, "snippet": { - "text": "Variables" + "text": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional" }, "sourceLanguage": "Python" }, @@ -6791,9 +6791,9 @@ "startLine": 1, "startColumn": 1, "charOffset": 0, - "charLength": 114, + "charLength": 101, "snippet": { - "text": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"" + "text": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional\n\nimport youtube_related" }, "sourceLanguage": "Python" } @@ -6807,50 +6807,50 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "be7606d77e92bcb99f2c7707d3c431b3ef89e217bc6015032fba692d52ca5bea" + "equalIndicator/v1": "136ccb973f1532ec4a24498878d0f7133196956e7c93b0252a4f714779767424" }, "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", "tags": [ "Python" ] } }, { - "ruleId": "PyUnboundLocalVariableInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", "level": "warning", "message": { - "text": "Local variable 'message' might be referenced before assignment", - "markdown": "Local variable 'message' might be referenced before assignment" + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/utils.py", + "uri": "requirements.txt", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 200, - "startColumn": 34, - "charOffset": 6797, - "charLength": 7, + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 290, "snippet": { - "text": "message" + "text": "PyNaCl==1.5.0\r\nspotipy==2.23.0\r\nrequests==2.31.0\r\nbeautifulsoup4==4.12.3\r\npsutil==5.9.8\r\ndisnake==2.9.1\r\npython-dotenv==1.0.1\r\nyt-dlp==2024.3.10\r\ncolorlog\r\nyoutube-related\r\nyoutube-search\r\ngit+https://github.com/Nat1anWasTaken/Lavalink.py.git\r\ngit+https://github.com/Snipy7374/disnake-ext-p" }, - "sourceLanguage": "Python" + "sourceLanguage": "Requirements" }, "contextRegion": { - "startLine": 198, + "startLine": 1, "startColumn": 1, - "charOffset": 6749, - "charLength": 134, + "charOffset": 0, + "charLength": 302, "snippet": { - "text": " )\n\n bot.loop.create_task(message.delete())\n except (AttributeError, UnboundLocalError):\n pass" + "text": "PyNaCl==1.5.0\r\nspotipy==2.23.0\r\nrequests==2.31.0\r\nbeautifulsoup4==4.12.3\r\npsutil==5.9.8\r\ndisnake==2.9.1\r\npython-dotenv==1.0.1\r\nyt-dlp==2024.3.10\r\ncolorlog\r\nyoutube-related\r\nyoutube-search\r\ngit+https://github.com/Nat1anWasTaken/Lavalink.py.git\r\ngit+https://github.com/Snipy7374/disnake-ext-paginator.git" }, - "sourceLanguage": "Python" + "sourceLanguage": "Requirements" } }, "logicalLocations": [ @@ -6862,48 +6862,48 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "3bb117c2c3e359a7a5f8ed0b50ce407ac692c970fc39560b0e1420e776256e95" + "equalIndicator/v1": "1b56100fe62f55703af7b41f49d06380d2cee152e81ea8c636aa99a054a2514a" }, "properties": { "ideaSeverity": "WARNING", "qodanaSeverity": "High", "tags": [ - "Python" + "Requirements" ] } }, { - "ruleId": "PyUnboundLocalVariableInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", - "level": "warning", + "level": "note", "message": { - "text": "Local variable 'player' might be referenced before assignment", - "markdown": "Local variable 'player' might be referenced before assignment" + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/cogs/commands.py", + "uri": "lava/bot.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 530, - "startColumn": 24, - "charOffset": 19229, - "charLength": 6, + "startLine": 6, + "startColumn": 6, + "charOffset": 129, + "charLength": 8, "snippet": { - "text": "player" + "text": "lavalink" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 528, + "startLine": 4, "startColumn": 1, - "charOffset": 19142, - "charLength": 255, + "charOffset": 40, + "charLength": 150, "snippet": { - "text": " await update_display(\n bot=self.bot,\n player=player or interaction.bot.lavalink.player_manager.get(interaction.guild.id),\n new_message=await interaction.original_response(),\n delay=5," + "text": "from disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n\nfrom lava.source import SourceManager" }, "sourceLanguage": "Python" } @@ -6917,48 +6917,48 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "f6e1002ca1c5f932e271808a48e75971f846c4c6be903ef118a41d1db00819fe" + "equalIndicator/v1": "5117b6d9efc1049655fc3582286b8fae6011a525df6217ced71dc5436d51abe5" }, "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", "tags": [ "Python" ] } }, { - "ruleId": "PyUnboundLocalVariableInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", "level": "warning", "message": { - "text": "Local variable 'message' might be referenced before assignment", - "markdown": "Local variable 'message' might be referenced before assignment" + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/utils.py", + "uri": "main.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 276, - "startColumn": 15, - "charOffset": 9670, - "charLength": 7, + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 1874, "snippet": { - "text": "message" + "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 274, + "startLine": 1, "startColumn": 1, - "charOffset": 9645, - "charLength": 222, + "charOffset": 0, + "charLength": 1874, "snippet": { - "text": "\n else:\n await message.edit(embed=generate_display_embed(bot, player), components=components)\n\n bot.logger.debug(\"Updating player in guild %s display message to %s\", bot.get_guild(player.guild_id), message.id)" + "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" }, "sourceLanguage": "Python" } @@ -6972,7 +6972,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "ff68674bac662da0c2613e990346fbca6b737585f7477127a4d881d42b5593c4" + "equalIndicator/v1": "5680ff4a266df72503f45fff36f082ccf4e4faa9c9383b9b6ea5a4ffd80ba4bc" }, "properties": { "ideaSeverity": "WARNING", @@ -6983,37 +6983,37 @@ } }, { - "ruleId": "PyUnusedLocalInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", "level": "note", "message": { - "text": "Parameter 'timeout' value is not used", - "markdown": "Parameter 'timeout' value is not used" + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/voice_client.py", + "uri": "lava/source.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 43, - "startColumn": 32, - "charOffset": 1363, - "charLength": 14, + "startLine": 9, + "startColumn": 6, + "charOffset": 168, + "charLength": 8, "snippet": { - "text": "timeout: float" + "text": "lavalink" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 41, + "startLine": 7, "startColumn": 1, - "charOffset": 1304, - "charLength": 184, + "charOffset": 117, + "charLength": 220, "snippet": { - "text": " self.cleanup()\n\n async def connect(self, *, timeout: float, reconnect: bool, self_deaf: bool = False,\n self_mute: bool = False) -> None:\n \"\"\"" + "text": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" }, "sourceLanguage": "Python" } @@ -7027,7 +7027,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "7aff68364220f438337fc6fc089e6cbe6cca8bc216919d92216baf7b011138e4" + "equalIndicator/v1": "582a95ad29e742907129965dc2001e5af48a88bacbea2742eb09e04a9e95ad77" }, "properties": { "ideaSeverity": "WEAK WARNING", @@ -7038,37 +7038,37 @@ } }, { - "ruleId": "PyUnusedLocalInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", "level": "note", "message": { - "text": "Parameter 'interaction' value is not used", - "markdown": "Parameter 'interaction' value is not used" + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/cogs/commands.py", + "uri": "lava/voice_client.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 684, - "startColumn": 28, - "charOffset": 24957, - "charLength": 42, + "startLine": 2, + "startColumn": 6, + "charOffset": 51, + "charLength": 8, "snippet": { - "text": "interaction: ApplicationCommandInteraction" + "text": "lavalink" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 682, + "startLine": 1, "startColumn": 1, - "charOffset": 24897, - "charLength": 249, + "charOffset": 0, + "charLength": 111, "snippet": { - "text": "\n @play.autocomplete(\"query\")\n async def search(self, interaction: ApplicationCommandInteraction, query: str):\n if re.match(r\"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+\", query):\n return []" + "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" }, "sourceLanguage": "Python" } @@ -7082,7 +7082,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "d75467a284812476427f939f071eaa47765aca768dc29f9bac63a2964823cef2" + "equalIndicator/v1": "6927ef1e2f2bb98a8996970181045339dba1ab5c27180f58ad1436546b84f77a" }, "properties": { "ideaSeverity": "WEAK WARNING", @@ -7093,37 +7093,37 @@ } }, { - "ruleId": "PyUnusedLocalInspection", + "ruleId": "PyPackageRequirementsInspection", "kind": "fail", - "level": "note", + "level": "warning", "message": { - "text": "Parameter 'reconnect' value is not used", - "markdown": "Parameter 'reconnect' value is not used" + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/voice_client.py", + "uri": "lava/embeds.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 43, - "startColumn": 48, - "charOffset": 1379, - "charLength": 15, + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 62, "snippet": { - "text": "reconnect: bool" + "text": "from typing import Union\n\nfrom disnake import Embed, Localized" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 41, + "startLine": 1, "startColumn": 1, - "charOffset": 1304, - "charLength": 184, + "charOffset": 0, + "charLength": 64, "snippet": { - "text": " self.cleanup()\n\n async def connect(self, *, timeout: float, reconnect: bool, self_deaf: bool = False,\n self_mute: bool = False) -> None:\n \"\"\"" + "text": "from typing import Union\n\nfrom disnake import Embed, Localized\n\n" }, "sourceLanguage": "Python" } @@ -7137,609 +7137,1302 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "da04a5cd4e65db71fdc174052f9f085a16ec32563813f4f883c2de9cc2d0e0ac" + "equalIndicator/v1": "7f0e264eb1139907c46ba81781ac2c40d694cfcc94b1400b9cb8e136cf13d63d" }, "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", "tags": [ "Python" ] } - } - ], - "automationDetails": { - "id": "project/qodana/2024-03-24", - "guid": "f597b70e-cecc-481e-a825-a881a493e30f", - "properties": { - "jobUrl": "https://github.com/Nat1anWasTaken/Lava/actions/runs/8409956980" - } - }, - "newlineSequences": [ - "\r\n", - "\n" - ], - "properties": { - "qodana.sanity.results": [ - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/utils.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 77, - "snippet": { - "text": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional" - }, - "sourceLanguage": "Python" + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/variables.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 114, + "snippet": { + "text": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 101, - "snippet": { - "text": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional\n\nimport youtube_related" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "0f2ae4d9ed418b29b9f57a32c4f2eb07ae60323307f25417e09d7a7fd84ae0cf" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 115, + "snippet": { + "text": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"\n" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "848a3cbf600e1b782177766315f923e15c2e127f853eea3a7768473c5b80c8a1" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/cogs/commands.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 32, - "snippet": { - "text": "import re\nfrom os import getpid\n" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/events.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 6, + "charOffset": 315, + "charLength": 8, + "snippet": { + "text": "lavalink" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 180, - "snippet": { - "text": "import re\nfrom os import getpid\n\nfrom disnake import Option, ApplicationCommandInteraction, OptionType, OptionChoice, ButtonStyle, Localized, Embed\nfrom disnake.ext import commands" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "34b4b5b7ebd58eccf9a05e7f09ece9f677a5525b95661150feb5e4b37f4002e9" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 218, + "charLength": 226, + "snippet": { + "text": "from disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "94012ee4094f84f8cc1f5c4c64c7122dd73ce8c0d190d7f8774466931486edeb" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/bot.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 39, - "snippet": { - "text": "import json\nfrom logging import Logger\n" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 6, + "charOffset": 297, + "charLength": 8, + "snippet": { + "text": "lavalink" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 123, - "snippet": { - "text": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "608446ec511e17c3e7634e044b01595f8c5a3d59fbd975e4815293dd13bc1cad" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 218, + "charLength": 246, + "snippet": { + "text": "from disnake.ui import Button\nfrom disnake_ext_paginator import Paginator\nfrom lavalink import DefaultPlayer, LoadResult, LoadType, Timescale, Tremolo, Vibrato, LowPass, Rotation, Equalizer\nfrom psutil import cpu_percent, virtual_memory, Process\n" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "a1a1dfa7722ddb4b15b355ebc1cb710ae1a5250af37bbeedfb6ac1ce71f0415e" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "main.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 1874, - "snippet": { - "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/bot.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 39, + "snippet": { + "text": "import json\nfrom logging import Logger\n" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 1874, - "snippet": { - "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "65041f2c4b132fbb8849787bfa455cd7d16e65f4f85a6d6de3321296f423575c" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 123, + "snippet": { + "text": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "a40ef4539a3e65f9be95278d50d0e2e6817f24260a1a06e48968aaf57cc0ba96" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/cogs/events.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 7344, - "snippet": { - "text": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Package containing module 'lavalink' is not listed in the project requirements", + "markdown": "Package containing module 'lavalink' is not listed in the project requirements" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/utils.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 11, + "startColumn": 6, + "charOffset": 345, + "charLength": 8, + "snippet": { + "text": "lavalink" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 7344, - "snippet": { - "text": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "6bb4836a3a1f496045060ed686569634a7f28b983597c6e5b78ccd342850a3d3" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 9, + "startColumn": 1, + "charOffset": 269, + "charLength": 155, + "snippet": { + "text": "from disnake.ui import Button, ActionRow\nfrom disnake.utils import get\nfrom lavalink import DefaultPlayer, parse_time, AudioTrack\n\nfrom lava.bot import Bot" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "b23571f15e0d6d91f64cd80f3e868011474e32eba74c7b6086a0ed5dba01b5b5" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/source.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 51, - "snippet": { - "text": "import json\nimport re\nfrom logging import getLogger" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/voice_client.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 110, + "snippet": { + "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 115, - "snippet": { - "text": "import json\nimport re\nfrom logging import getLogger\nfrom os import getenv\nfrom typing import Union, Tuple, Optional" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "82b2eb7ec5274df8edb99a9eb41dfffec6c0a161b97dca97a72a0b4d0d8906ce" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 136, + "snippet": { + "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n\nfrom lava.bot import Bot" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "b63d746d829b1201df727199567e86b6a9259382307f7f2a382b0e9b6571dd60" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/errors.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 37, - "snippet": { - "text": "from disnake.abc import Connectable\n\n" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/errors.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 37, + "snippet": { + "text": "from disnake.abc import Connectable\n\n" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 79, - "snippet": { - "text": "from disnake.abc import Connectable\n\n\nclass UserNotInVoice(Exception):\n pass" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "83fdd9baa341ec764dcb50b4791639640ddc7fc31a611e4b24494139193e5667" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 79, + "snippet": { + "text": "from disnake.abc import Connectable\n\n\nclass UserNotInVoice(Exception):\n pass" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "c55f5e5d18dd60a11d8a4aa0cefb07ff92a65bbba01a8983265f415294593215" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/variables.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 114, - "snippet": { - "text": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/events.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 7344, + "snippet": { + "text": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 115, - "snippet": { - "text": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"\n" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "920ee80fcb895ece91d14b1b57f0dbec728ee53609a9bc96e5d4dec713bd62a2" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 7344, + "snippet": { + "text": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "c9d3bf86848363e7aef7e126fe104a997fc1a9063281b89893c1ecef6b69c194" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/voice_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 110, - "snippet": { - "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get" - }, - "sourceLanguage": "Python" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/source.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 51, + "snippet": { + "text": "import json\nimport re\nfrom logging import getLogger" }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 136, - "snippet": { - "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n\nfrom lava.bot import Bot" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "Python" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "b1402f2443407a2a86084f53ef71344806ebcafa2936c15f2aab8eecd7f20a4f" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 115, + "snippet": { + "text": "import json\nimport re\nfrom logging import getLogger\nfrom os import getenv\nfrom typing import Union, Tuple, Optional" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "dcee15d6edb75a2a6ba220d4dc46c9f6c229fc06a4fef0b479b28e9fd95da968" }, - { - "ruleId": "PyInterpreterInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "No Python interpreter configured for the project", - "markdown": "No Python interpreter configured for the project" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/embeds.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 62, - "snippet": { - "text": "from typing import Union\n\nfrom disnake import Embed, Localized" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 1, - "startColumn": 1, - "charOffset": 0, - "charLength": 64, - "snippet": { - "text": "from typing import Union\n\nfrom disnake import Embed, Localized\n\n" - }, - "sourceLanguage": "Python" - } + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPackageRequirementsInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "markdown": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 32, + "snippet": { + "text": "import re\nfrom os import getpid\n" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 1, + "startColumn": 1, + "charOffset": 0, + "charLength": 180, + "snippet": { + "text": "import re\nfrom os import getpid\n\nfrom disnake import Option, ApplicationCommandInteraction, OptionType, OptionChoice, ButtonStyle, Localized, Embed\nfrom disnake.ext import commands" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "e6374dcbe747a68b6b0beac60a921557e4754905cd9dc59c91fd88e5aac7c454" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E501 line too long (126 > 120 characters)", + "markdown": "PEP 8: E501 line too long (126 \\> 120 characters)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/utils.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 412, + "startColumn": 117, + "charOffset": 14638, + "charLength": 5, + "snippet": { + "text": "'SF|'" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 410, + "startColumn": 1, + "charOffset": 14374, + "charLength": 481, + "snippet": { + "text": " return f\"{bot.get_icon('progress.start_point', 'ST|')}\" \\\n f\"{bot.get_icon('progress.start_fill', 'SF|') * round(percentage * 10)}\" \\\n f\"{bot.get_icon('progress.mid_point', 'MP|') if percentage != 1 else bot.get_icon('progress.start_fill', 'SF|')}\" \\\n f\"{bot.get_icon('progress.end_fill', 'EF|') * round((1 - percentage) * 10)}\" \\\n f\"{bot.get_icon('progress.end', 'ED|') if percentage != 1 else bot.get_icon('progress.end_point', 'EP')}\"" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "1193e0955ccff5b2dbdc81145b0982066d94ecf5de17ec7357158f9049ccb9ae" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E501 line too long (126 > 120 characters)", + "markdown": "PEP 8: E501 line too long (126 \\> 120 characters)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/source.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 319, + "startColumn": 26, + "charOffset": 9678, + "charLength": 101, + "snippet": { + "text": "r\"^(https?://(www\\.)?(youtube\\.com|music\\.youtube\\.com)/(watch\\?v=|playlist\\?list=)([a-zA-Z0-9_-]+))\"" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 317, + "startColumn": 1, + "charOffset": 9605, + "charLength": 219, + "snippet": { + "text": "\n def check_query(self, query: str) -> bool:\n youtube_url_rx = r\"^(https?://(www\\.)?(youtube\\.com|music\\.youtube\\.com)/(watch\\?v=|playlist\\?list=)([a-zA-Z0-9_-]+))\"\n\n if re.match(youtube_url_rx, query):" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "24d5e21f04645740f75ff56a64dd6b000a3924497c9df20079721cb4a1a43eb7" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E501 line too long (127 > 120 characters)", + "markdown": "PEP 8: E501 line too long (127 \\> 120 characters)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 841, + "startColumn": 118, + "charOffset": 30867, + "charLength": 8, + "snippet": { + "text": "__name__" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 839, + "startColumn": 1, + "charOffset": 30660, + "charLength": 249, + "snippet": { + "text": " await interaction.edit_original_response(\n embed=SuccessEmbed(\n f\"{self.bot.get_text('command.filters.removed', locale, '已移除效果器')}:{allowed_filters[filter_name].__name__}\"\n )\n )" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "4405d48ee1103a5c98b6f64228f22cfa68506aa9c8f66ffc3145c56fa4f1758b" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E501 line too long (165 > 120 characters)", + "markdown": "PEP 8: E501 line too long (165 \\> 120 characters)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 212, + "startColumn": 117, + "charOffset": 7890, + "charLength": 7, + "snippet": { + "text": "results" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 210, + "startColumn": 1, + "charOffset": 7700, + "charLength": 338, + "snippet": { + "text": " embeds=[\n SuccessEmbed(\n title=f\"{self.bot.get_text('command.play.loaded.title', locale, '已加入播放序列')} {len(results.tracks)} / {results.playlist_info.name}\",\n description='\\n'.join(\n [" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "515bdeb46d9ef457a64ba671c2715b5c435514305c040ce7c90185b7ee3f4cb0" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E131 continuation line unaligned for hanging indent", + "markdown": "PEP 8: E131 continuation line unaligned for hanging indent" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/utils.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 353, + "startColumn": 19, + "charOffset": 12673, + "charLength": 3, + "snippet": { + "text": "bot" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 351, + "startColumn": 1, + "charOffset": 12521, + "charLength": 221, + "snippet": { + "text": " ]\n ) + (f\"\\n{bot.get_text('display.queue.more', locale, '還有更多...')}\" if len(player.queue) > 5 else \"\")) or\n bot.get_text(\"empty\", locale, \"空\"),\n inline=True\n )" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "5fca3442d7b1bf629ab1019144384538d008b1bb3ba673bc6980da9bf202740a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyPep8Inspection", + "kind": "fail", + "level": "note", + "message": { + "text": "PEP 8: E501 line too long (193 > 120 characters)", + "markdown": "PEP 8: E501 line too long (193 \\> 120 characters)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 675, + "startColumn": 121, + "charOffset": 24654, + "charLength": 4, + "snippet": { + "text": "'開啟'" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 673, + "startColumn": 1, + "charOffset": 24452, + "charLength": 299, + "snippet": { + "text": " await interaction.edit_original_response(\n embed=SuccessEmbed(\n f\"{self.bot.get_text('command.shuffle.success', locale, '隨機播放模式')}:{self.bot.get_text('enable', locale, '開啟') if player.shuffle else self.bot.get_text('disable', locale, '關閉')}\"\n )\n )" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "d1a2e4598c0bb84fe9fb4a1f22ad15e02a74cd8265da3ca49cb3730b3bd6a89a" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnboundLocalVariableInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Local variable 'message' might be referenced before assignment", + "markdown": "Local variable 'message' might be referenced before assignment" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/utils.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 200, + "startColumn": 34, + "charOffset": 6797, + "charLength": 7, + "snippet": { + "text": "message" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 198, + "startColumn": 1, + "charOffset": 6749, + "charLength": 134, + "snippet": { + "text": " )\n\n bot.loop.create_task(message.delete())\n except (AttributeError, UnboundLocalError):\n pass" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "3bb117c2c3e359a7a5f8ed0b50ce407ac692c970fc39560b0e1420e776256e95" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnboundLocalVariableInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Local variable 'player' might be referenced before assignment", + "markdown": "Local variable 'player' might be referenced before assignment" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 530, + "startColumn": 24, + "charOffset": 19229, + "charLength": 6, + "snippet": { + "text": "player" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 528, + "startColumn": 1, + "charOffset": 19142, + "charLength": 255, + "snippet": { + "text": " await update_display(\n bot=self.bot,\n player=player or interaction.bot.lavalink.player_manager.get(interaction.guild.id),\n new_message=await interaction.original_response(),\n delay=5," + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "f6e1002ca1c5f932e271808a48e75971f846c4c6be903ef118a41d1db00819fe" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnboundLocalVariableInspection", + "kind": "fail", + "level": "warning", + "message": { + "text": "Local variable 'message' might be referenced before assignment", + "markdown": "Local variable 'message' might be referenced before assignment" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/utils.py", + "uriBaseId": "SRCROOT" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "c04f38b138402afbe6b8f4f15ae4a25ca7b4d2f4c9db87ebba038a7f03c51891" - }, - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High" + "region": { + "startLine": 276, + "startColumn": 15, + "charOffset": 9670, + "charLength": 7, + "snippet": { + "text": "message" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 274, + "startColumn": 1, + "charOffset": 9645, + "charLength": 222, + "snippet": { + "text": "\n else:\n await message.edit(embed=generate_display_embed(bot, player), components=components)\n\n bot.logger.debug(\"Updating player in guild %s display message to %s\", bot.get_guild(player.guild_id), message.id)" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "ff68674bac662da0c2613e990346fbca6b737585f7477127a4d881d42b5593c4" }, - { - "ruleId": "PyUnresolvedReferencesInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Unresolved reference 'Exception'", - "markdown": "Unresolved reference 'Exception'" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "lava/errors.py", - "uriBaseId": "SRCROOT" + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnusedLocalInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Parameter 'timeout' value is not used", + "markdown": "Parameter 'timeout' value is not used" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/voice_client.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 43, + "startColumn": 32, + "charOffset": 1363, + "charLength": 14, + "snippet": { + "text": "timeout: float" }, - "region": { - "startLine": 8, - "startColumn": 21, - "charOffset": 102, - "charLength": 9, - "snippet": { - "text": "Exception" - }, - "sourceLanguage": "Python" + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 41, + "startColumn": 1, + "charOffset": 1304, + "charLength": 184, + "snippet": { + "text": " self.cleanup()\n\n async def connect(self, *, timeout: float, reconnect: bool, self_deaf: bool = False,\n self_mute: bool = False) -> None:\n \"\"\"" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "7aff68364220f438337fc6fc089e6cbe6cca8bc216919d92216baf7b011138e4" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnusedLocalInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Parameter 'interaction' value is not used", + "markdown": "Parameter 'interaction' value is not used" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 684, + "startColumn": 28, + "charOffset": 24957, + "charLength": 42, + "snippet": { + "text": "interaction: ApplicationCommandInteraction" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 682, + "startColumn": 1, + "charOffset": 24897, + "charLength": 249, + "snippet": { + "text": "\n @play.autocomplete(\"query\")\n async def search(self, interaction: ApplicationCommandInteraction, query: str):\n if re.match(r\"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+\", query):\n return []" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "d75467a284812476427f939f071eaa47765aca768dc29f9bac63a2964823cef2" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "PyUnusedLocalInspection", + "kind": "fail", + "level": "note", + "message": { + "text": "Parameter 'reconnect' value is not used", + "markdown": "Parameter 'reconnect' value is not used" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/voice_client.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 43, + "startColumn": 48, + "charOffset": 1379, + "charLength": 15, + "snippet": { + "text": "reconnect: bool" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 41, + "startColumn": 1, + "charOffset": 1304, + "charLength": 184, + "snippet": { + "text": " self.cleanup()\n\n async def connect(self, *, timeout: float, reconnect: bool, self_deaf: bool = False,\n self_mute: bool = False) -> None:\n \"\"\"" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "da04a5cd4e65db71fdc174052f9f085a16ec32563813f4f883c2de9cc2d0e0ac" + }, + "properties": { + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "tags": [ + "Python" + ] + } + }, + { + "ruleId": "RegExpUnnecessaryNonCapturingGroup", + "kind": "fail", + "level": "warning", + "message": { + "text": "Unnecessary non-capturing group '(?:%[0-9a-fA-F][0-9a-fA-F])'", + "markdown": "Unnecessary non-capturing group `(?:%[0-9a-fA-F][0-9a-fA-F])`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/cogs/commands.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 685, + "startColumn": 72, + "charOffset": 25085, + "charLength": 3, + "snippet": { + "text": "(?:" }, - "contextRegion": { - "startLine": 6, - "startColumn": 1, - "charOffset": 80, - "charLength": 43, - "snippet": { - "text": "\n\nclass BotNotInVoice(Exception):\n pass\n" - }, - "sourceLanguage": "Python" - } + "sourceLanguage": "RegExp" }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v1": "22403c00f7e6a62353763b95245de8547295865f9e6356f3a8c7b28e27804a37" - }, - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical" + "contextRegion": { + "startLine": 683, + "startColumn": 1, + "charOffset": 24898, + "charLength": 249, + "snippet": { + "text": " @play.autocomplete(\"query\")\n async def search(self, interaction: ApplicationCommandInteraction, query: str):\n if re.match(r\"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+\", query):\n return []\n" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] } + ], + "partialFingerprints": { + "equalIndicator/v1": "bcc0433c069222049eaace56689a6744fbd639637b985a835f2687c976921e81" }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "tags": [ + "RegExp" + ] + } + } + ], + "automationDetails": { + "id": "project/qodana/2024-03-25", + "guid": "5b054bf9-77b2-4856-af8f-1c2a973eb9f6", + "properties": { + "jobUrl": "https://github.com/Nat1anWasTaken/Lava/actions/runs/8416182239" + } + }, + "newlineSequences": [ + "\r\n", + "\n" + ], + "properties": { + "qodana.sanity.results": [ { "ruleId": "PyUnresolvedReferencesInspection", "kind": "fail", "level": "error", "message": { - "text": "No module named 'asyncio'", - "markdown": "No module named 'asyncio'" + "text": "Unresolved reference 'disnake'", + "markdown": "Unresolved reference 'disnake'" }, "locations": [ { @@ -7749,22 +8442,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 1, - "startColumn": 8, - "charOffset": 7, + "startLine": 8, + "startColumn": 6, + "charOffset": 125, "charLength": 7, "snippet": { - "text": "asyncio" + "text": "disnake" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 6, "startColumn": 1, - "charOffset": 0, - "charLength": 44, + "charOffset": 79, + "charLength": 152, "snippet": { - "text": "import asyncio\r\nimport json\r\nimport logging\r" + "text": "\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r" }, "sourceLanguage": "Python" } @@ -7778,7 +8471,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "3ff10b8c1a10e77b931f14ff44714dd87ad826f3f8e4b8c47a3dca5402298cb1" + "equalIndicator/v1": "36b78d35da92927826a0f2e3b4c11811cf22fcac61558f8d3d5e09ee4f4a9ec6" }, "properties": { "ideaSeverity": "ERROR", @@ -7894,33 +8587,33 @@ "kind": "fail", "level": "error", "message": { - "text": "No module named 'os'", - "markdown": "No module named 'os'" + "text": "Unresolved reference 'Source'", + "markdown": "Unresolved reference 'Source'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "main.py", + "uri": "lava/source.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 4, - "startColumn": 8, - "charOffset": 52, - "charLength": 2, + "startLine": 9, + "startColumn": 22, + "charOffset": 184, + "charLength": 6, "snippet": { - "text": "os" + "text": "Source" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 2, + "startLine": 7, "startColumn": 1, - "charOffset": 16, - "charLength": 64, + "charOffset": 117, + "charLength": 220, "snippet": { - "text": "import json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r" + "text": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" }, "sourceLanguage": "Python" } @@ -7934,7 +8627,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "530ea58751d98cf03e716370c6d03fb8108a1a384171be6327963a8b310ca150" + "equalIndicator/v1": "558653979545d7d2f6618222402bc4cc6d2cd11a47c484188e8844d112040f71" }, "properties": { "ideaSeverity": "ERROR", @@ -7946,33 +8639,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'disnake'", - "markdown": "Unresolved reference 'disnake'" + "text": "Unresolved reference 'BeautifulSoup'", + "markdown": "Unresolved reference 'BeautifulSoup'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/bot.py", + "uri": "lava/source.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 4, - "startColumn": 6, - "charOffset": 45, - "charLength": 7, + "startLine": 8, + "startColumn": 17, + "charOffset": 149, + "charLength": 13, "snippet": { - "text": "disnake" + "text": "BeautifulSoup" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 2, + "startLine": 6, "startColumn": 1, - "charOffset": 12, - "charLength": 139, + "charOffset": 116, + "charLength": 192, "snippet": { - "text": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" + "text": "\nimport requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials" }, "sourceLanguage": "Python" } @@ -7986,7 +8679,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "56f04ef5cde4350c9ca6b392982da630abe437059ac4e7ffab8555cea03664ec" + "equalIndicator/v1": "569053e57a7f4ce5251c171c9d5813c629b82ea3ebbe920cf581687bf2e8b5a5" }, "properties": { "ideaSeverity": "ERROR", @@ -7998,33 +8691,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'Union'", - "markdown": "Unresolved reference 'Union'" + "text": "Unresolved reference 'disnake'", + "markdown": "Unresolved reference 'disnake'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/embeds.py", + "uri": "lava/bot.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 1, - "startColumn": 20, - "charOffset": 19, - "charLength": 5, + "startLine": 4, + "startColumn": 6, + "charOffset": 45, + "charLength": 7, "snippet": { - "text": "Union" + "text": "disnake" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 2, "startColumn": 1, - "charOffset": 0, - "charLength": 62, + "charOffset": 12, + "charLength": 139, "snippet": { - "text": "from typing import Union\n\nfrom disnake import Embed, Localized" + "text": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" }, "sourceLanguage": "Python" } @@ -8038,7 +8731,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "635fb084d35f67b8583629eb3da8f9ae9acfc7fc6c115a4ab2de487ceaf5cbdb" + "equalIndicator/v1": "56f04ef5cde4350c9ca6b392982da630abe437059ac4e7ffab8555cea03664ec" }, "properties": { "ideaSeverity": "ERROR", @@ -8102,33 +8795,33 @@ "kind": "fail", "level": "error", "message": { - "text": "No module named 'json'", - "markdown": "No module named 'json'" + "text": "Unresolved reference 'MISSING'", + "markdown": "Unresolved reference 'MISSING'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "main.py", + "uri": "lava/bot.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 2, - "startColumn": 8, - "charOffset": 23, - "charLength": 4, + "startLine": 4, + "startColumn": 25, + "charOffset": 64, + "charLength": 7, "snippet": { - "text": "json" + "text": "MISSING" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 2, "startColumn": 1, - "charOffset": 0, - "charLength": 55, + "charOffset": 12, + "charLength": 139, "snippet": { - "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r" + "text": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" }, "sourceLanguage": "Python" } @@ -8142,7 +8835,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "76c9538e4faafc3f46f3476f2b2445c32b5cc929543090824ea48be424e85de0" + "equalIndicator/v1": "74360414930cea80a9b41d4dabfb02cf767943240d0e42fb8b4e9d2a9749b1bb" }, "properties": { "ideaSeverity": "ERROR", @@ -8154,23 +8847,23 @@ "kind": "fail", "level": "error", "message": { - "text": "No module named 'logging'", - "markdown": "No module named 'logging'" + "text": "Unresolved reference 'lavalink'", + "markdown": "Unresolved reference 'lavalink'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "main.py", + "uri": "lava/voice_client.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 3, - "startColumn": 8, - "charOffset": 36, - "charLength": 7, + "startLine": 2, + "startColumn": 6, + "charOffset": 51, + "charLength": 8, "snippet": { - "text": "logging" + "text": "lavalink" }, "sourceLanguage": "Python" }, @@ -8178,9 +8871,9 @@ "startLine": 1, "startColumn": 1, "charOffset": 0, - "charLength": 78, + "charLength": 111, "snippet": { - "text": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r" + "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" }, "sourceLanguage": "Python" } @@ -8194,7 +8887,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "7d9905cd6424abd8a427065088b2e6c0a15606218f4f9a7006004db21a660309" + "equalIndicator/v1": "84ea173295f4f3aee284ad09db79ba824eccb3016b6f2e0699aeba72f3cb3b99" }, "properties": { "ideaSeverity": "ERROR", @@ -8206,33 +8899,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'lavalink'", - "markdown": "Unresolved reference 'lavalink'" + "text": "Unresolved reference 'bs4'", + "markdown": "Unresolved reference 'bs4'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/voice_client.py", + "uri": "lava/source.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 2, + "startLine": 8, "startColumn": 6, - "charOffset": 51, - "charLength": 8, + "charOffset": 138, + "charLength": 3, "snippet": { - "text": "lavalink" + "text": "bs4" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 6, "startColumn": 1, - "charOffset": 0, - "charLength": 111, + "charOffset": 116, + "charLength": 192, "snippet": { - "text": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" + "text": "\nimport requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials" }, "sourceLanguage": "Python" } @@ -8246,7 +8939,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "84ea173295f4f3aee284ad09db79ba824eccb3016b6f2e0699aeba72f3cb3b99" + "equalIndicator/v1": "8f55e0ba549841996971a8cb8c9a826762b7a2003061dfc20b25ca1573c2b753" }, "properties": { "ideaSeverity": "ERROR", @@ -8310,33 +9003,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'logging'", - "markdown": "Unresolved reference 'logging'" + "text": "Unresolved reference 'ColoredFormatter'", + "markdown": "Unresolved reference 'ColoredFormatter'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/bot.py", + "uri": "main.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 2, - "startColumn": 6, - "charOffset": 17, - "charLength": 7, + "startLine": 7, + "startColumn": 22, + "charOffset": 102, + "charLength": 16, "snippet": { - "text": "logging" + "text": "ColoredFormatter" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 5, "startColumn": 1, - "charOffset": 0, - "charLength": 71, + "charOffset": 56, + "charLength": 143, "snippet": { - "text": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING" + "text": "from os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r" }, "sourceLanguage": "Python" } @@ -8350,7 +9043,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "9b0e0f5e4476e44ffde08b245a121f682e6619dd90c409521e1a0141aa8818a5" + "equalIndicator/v1": "b7cb1fba0fed10cdd8f1fc797e84a1b3793b0b66f03718fd40f9ea4931049e2a" }, "properties": { "ideaSeverity": "ERROR", @@ -8362,33 +9055,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'Exception'", - "markdown": "Unresolved reference 'Exception'" + "text": "Unresolved reference 'Bot'", + "markdown": "Unresolved reference 'Bot'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/errors.py", + "uri": "lava/bot.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 4, - "startColumn": 22, - "charOffset": 59, - "charLength": 9, + "startLine": 5, + "startColumn": 34, + "charOffset": 105, + "charLength": 3, "snippet": { - "text": "Exception" + "text": "Bot" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 2, + "startLine": 3, "startColumn": 1, - "charOffset": 36, - "charLength": 44, + "charOffset": 39, + "charLength": 113, "snippet": { - "text": "\n\nclass UserNotInVoice(Exception):\n pass\n" + "text": "\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n" }, "sourceLanguage": "Python" } @@ -8402,7 +9095,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "ca1cb7e1a451961ee2a844f0baef086fb085591584ccd185e9afde69be4fb8bf" + "equalIndicator/v1": "cb1dd8b4f4b8779d0ff673bcf0696cc136b9393ddc2e5d2d5ca4706cc2db3e08" }, "properties": { "ideaSeverity": "ERROR", @@ -8414,33 +9107,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'Logger'", - "markdown": "Unresolved reference 'Logger'" + "text": "Unresolved reference 'Intents'", + "markdown": "Unresolved reference 'Intents'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/bot.py", + "uri": "main.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 2, + "startLine": 8, "startColumn": 21, - "charOffset": 32, - "charLength": 6, + "charOffset": 140, + "charLength": 7, "snippet": { - "text": "Logger" + "text": "Intents" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 6, "startColumn": 1, - "charOffset": 0, - "charLength": 71, + "charOffset": 79, + "charLength": 152, "snippet": { - "text": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING" + "text": "\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r" }, "sourceLanguage": "Python" } @@ -8454,7 +9147,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "cc7097b4f547688980830e6e1610da0e65fb7a7a0bcf81cea4118582ee8c3f71" + "equalIndicator/v1": "e364f17e4dcb99fec398835367023a76b62b48f178f5f28d0e17996ddc7514cd" }, "properties": { "ideaSeverity": "ERROR", @@ -8466,33 +9159,33 @@ "kind": "fail", "level": "error", "message": { - "text": "Unresolved reference 'typing'", - "markdown": "Unresolved reference 'typing'" + "text": "Unresolved reference 'colorlog'", + "markdown": "Unresolved reference 'colorlog'" }, "locations": [ { "physicalLocation": { "artifactLocation": { - "uri": "lava/embeds.py", + "uri": "main.py", "uriBaseId": "SRCROOT" }, "region": { - "startLine": 1, + "startLine": 7, "startColumn": 6, - "charOffset": 5, - "charLength": 6, + "charOffset": 86, + "charLength": 8, "snippet": { - "text": "typing" + "text": "colorlog" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 5, "startColumn": 1, - "charOffset": 0, - "charLength": 62, + "charOffset": 56, + "charLength": 143, "snippet": { - "text": "from typing import Union\n\nfrom disnake import Embed, Localized" + "text": "from os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r" }, "sourceLanguage": "Python" } @@ -8506,7 +9199,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "e3afe4f0cf4eab8da3ebb16df156d41fb669caceffaea96bc441a8ac6acb113c" + "equalIndicator/v1": "e686808a889fc7f84fb1d6055711729084ec3f616a6d5926b0b9181850a97f90" }, "properties": { "ideaSeverity": "ERROR", @@ -8570,8 +9263,8 @@ "kind": "fail", "level": "error", "message": { - "text": "No module named 'json'", - "markdown": "No module named 'json'" + "text": "Unresolved reference 'disnake'", + "markdown": "Unresolved reference 'disnake'" }, "locations": [ { @@ -8581,22 +9274,22 @@ "uriBaseId": "SRCROOT" }, "region": { - "startLine": 1, - "startColumn": 8, - "charOffset": 7, - "charLength": 4, + "startLine": 5, + "startColumn": 6, + "charOffset": 77, + "charLength": 7, "snippet": { - "text": "json" + "text": "disnake" }, "sourceLanguage": "Python" }, "contextRegion": { - "startLine": 1, + "startLine": 3, "startColumn": 1, - "charOffset": 0, - "charLength": 39, + "charOffset": 39, + "charLength": 113, "snippet": { - "text": "import json\nfrom logging import Logger\n" + "text": "\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n" }, "sourceLanguage": "Python" } @@ -8610,7 +9303,7 @@ } ], "partialFingerprints": { - "equalIndicator/v1": "f6158208da390ef9c169759c4e651ff041a971c724d9b413c3f6d07cda187566" + "equalIndicator/v1": "f92fbf30f13a1f4b731dfd48f2a8820215cf4460c4d8c06e82ea180e05436d38" }, "properties": { "ideaSeverity": "ERROR", @@ -8720,14 +9413,66 @@ "ideaSeverity": "ERROR", "qodanaSeverity": "Critical" } + }, + { + "ruleId": "PyUnresolvedReferencesInspection", + "kind": "fail", + "level": "error", + "message": { + "text": "Unresolved reference 'lavalink'", + "markdown": "Unresolved reference 'lavalink'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "lava/source.py", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 6, + "charOffset": 168, + "charLength": 8, + "snippet": { + "text": "lavalink" + }, + "sourceLanguage": "Python" + }, + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 117, + "charLength": 220, + "snippet": { + "text": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" + }, + "sourceLanguage": "Python" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "project", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v1": "ffc795f612442c3bec41d08e0735ac11693f194c514422842dbb31abeb9bb3c0" + }, + "properties": { + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical" + } } ], "configProfile": "absent", "deviceId": "200820300000000-f46c-a99e-6401-ff7b7532c766", "qodanaNewResultSummary": { - "moderate": 5, - "high": 3, - "total": 8 + "moderate": 16, + "high": 15, + "total": 31 } } } diff --git a/results/result-allProblems.json b/results/result-allProblems.json index 0bdd1324..5b4da96f 100644 --- a/results/result-allProblems.json +++ b/results/result-allProblems.json @@ -32,34 +32,716 @@ },{ "tool": "Code Inspection", "category": "Python", - "type": "Class has no `__init__` method", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/utils.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 77, + "code": { + "startLine": 1, + "length": 77, + "offset": 0, + "surroundingCode": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional\n\nimport youtube_related" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "136ccb973f1532ec4a24498878d0f7133196956e7c93b0252a4f714779767424" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Requirements" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "requirements.txt", + "language": "Requirements", + "line": 1, + "offset": 1, + "length": 290, + "code": { + "startLine": 1, + "length": 290, + "offset": 0, + "surroundingCode": "PyNaCl==1.5.0\r\nspotipy==2.23.0\r\nrequests==2.31.0\r\nbeautifulsoup4==4.12.3\r\npsutil==5.9.8\r\ndisnake==2.9.1\r\npython-dotenv==1.0.1\r\nyt-dlp==2024.3.10\r\ncolorlog\r\nyoutube-related\r\nyoutube-search\r\ngit+https://github.com/Nat1anWasTaken/Lavalink.py.git\r\ngit+https://github.com/Snipy7374/disnake-ext-paginator.git" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "1b56100fe62f55703af7b41f49d06380d2cee152e81ea8c636aa99a054a2514a" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/bot.py", + "language": "Python", + "line": 6, + "offset": 6, + "length": 8, + "code": { + "startLine": 4, + "length": 8, + "offset": 89, + "surroundingCode": "from disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n\nfrom lava.source import SourceManager" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "5117b6d9efc1049655fc3582286b8fae6011a525df6217ced71dc5436d51abe5" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "main.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 1874, + "code": { + "startLine": 1, + "length": 1874, + "offset": 0, + "surroundingCode": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "5680ff4a266df72503f45fff36f082ccf4e4faa9c9383b9b6ea5a4ffd80ba4bc" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/source.py", + "language": "Python", + "line": 9, + "offset": 6, + "length": 8, + "code": { + "startLine": 7, + "length": 8, + "offset": 51, + "surroundingCode": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "582a95ad29e742907129965dc2001e5af48a88bacbea2742eb09e04a9e95ad77" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", "tags": [ "Python" ], "severity": "Moderate", - "comment": "Class has no __init__ method", - "detailsInfo": "Reports cases in Python 2 when a class has no `__init__` method, neither its parent\nclasses.\n\n**Example:**\n\n\n class Book():\n pass\n\nThe quick-fix adds the `__init__` method:\n\n\n class Book():\n def __init__(self):\n pass\n", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/voice_client.py", + "language": "Python", + "line": 2, + "offset": 6, + "length": 8, + "code": { + "startLine": 1, + "length": 8, + "offset": 51, + "surroundingCode": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "6927ef1e2f2bb98a8996970181045339dba1ab5c27180f58ad1436546b84f77a" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/embeds.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 62, + "code": { + "startLine": 1, + "length": 62, + "offset": 0, + "surroundingCode": "from typing import Union\n\nfrom disnake import Embed, Localized\n\n" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "7f0e264eb1139907c46ba81781ac2c40d694cfcc94b1400b9cb8e136cf13d63d" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", "sources": [ { "type": "file", "path": "lava/variables.py", "language": "Python", "line": 1, - "offset": 7, - "length": 9, + "offset": 1, + "length": 114, + "code": { + "startLine": 1, + "length": 114, + "offset": 0, + "surroundingCode": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"\n" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "848a3cbf600e1b782177766315f923e15c2e127f853eea3a7768473c5b80c8a1" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/events.py", + "language": "Python", + "line": 9, + "offset": 6, + "length": 8, + "code": { + "startLine": 7, + "length": 8, + "offset": 97, + "surroundingCode": "from disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "94012ee4094f84f8cc1f5c4c64c7122dd73ce8c0d190d7f8774466931486edeb" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 9, + "offset": 6, + "length": 8, + "code": { + "startLine": 7, + "length": 8, + "offset": 79, + "surroundingCode": "from disnake.ui import Button\nfrom disnake_ext_paginator import Paginator\nfrom lavalink import DefaultPlayer, LoadResult, LoadType, Timescale, Tremolo, Vibrato, LowPass, Rotation, Equalizer\nfrom psutil import cpu_percent, virtual_memory, Process\n" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "a1a1dfa7722ddb4b15b355ebc1cb710ae1a5250af37bbeedfb6ac1ce71f0415e" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/bot.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 39, + "code": { + "startLine": 1, + "length": 39, + "offset": 0, + "surroundingCode": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "a40ef4539a3e65f9be95278d50d0e2e6817f24260a1a06e48968aaf57cc0ba96" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "Package containing module 'lavalink' is not listed in the project requirements", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/utils.py", + "language": "Python", + "line": 11, + "offset": 6, + "length": 8, + "code": { + "startLine": 9, + "length": 8, + "offset": 76, + "surroundingCode": "from disnake.ui import Button, ActionRow\nfrom disnake.utils import get\nfrom lavalink import DefaultPlayer, parse_time, AudioTrack\n\nfrom lava.bot import Bot" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "b23571f15e0d6d91f64cd80f3e868011474e32eba74c7b6086a0ed5dba01b5b5" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/voice_client.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 110, + "code": { + "startLine": 1, + "length": 110, + "offset": 0, + "surroundingCode": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n\nfrom lava.bot import Bot" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "b63d746d829b1201df727199567e86b6a9259382307f7f2a382b0e9b6571dd60" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/errors.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 37, + "code": { + "startLine": 1, + "length": 37, + "offset": 0, + "surroundingCode": "from disnake.abc import Connectable\n\n\nclass UserNotInVoice(Exception):\n pass" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "c55f5e5d18dd60a11d8a4aa0cefb07ff92a65bbba01a8983265f415294593215" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/events.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 7344, + "code": { + "startLine": 1, + "length": 7344, + "offset": 0, + "surroundingCode": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "c9d3bf86848363e7aef7e126fe104a997fc1a9063281b89893c1ecef6b69c194" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/source.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 51, + "code": { + "startLine": 1, + "length": 51, + "offset": 0, + "surroundingCode": "import json\nimport re\nfrom logging import getLogger\nfrom os import getenv\nfrom typing import Union, Tuple, Optional" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "dcee15d6edb75a2a6ba220d4dc46c9f6c229fc06a4fef0b479b28e9fd95da968" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unsatisfied package requirements", + "tags": [ + "Python" + ], + "severity": "High", + "comment": "Package requirements 'PyNaCl==1.5.0', 'spotipy==2.23.0', 'beautifulsoup4==4.12.3', 'psutil==5.9.8', 'disnake==2.9.1', 'python-dotenv==1.0.1', 'yt-dlp==2024.3.10', 'colorlog', 'youtube-related', 'youtube-search', 'Lavalink.py', 'disnake-ext-paginator' are not satisfied", + "detailsInfo": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 1, + "offset": 1, + "length": 32, "code": { "startLine": 1, - "length": 9, - "offset": 6, - "surroundingCode": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"" + "length": 32, + "offset": 0, + "surroundingCode": "import re\nfrom os import getpid\n\nfrom disnake import Option, ApplicationCommandInteraction, OptionType, OptionChoice, ButtonStyle, Localized, Embed\nfrom disnake.ext import commands" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPackageRequirementsInspection" + }, + "hash": "e6374dcbe747a68b6b0beac60a921557e4754905cd9dc59c91fd88e5aac7c454" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E501 line too long (126 \\> 120 characters)", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/utils.py", + "language": "Python", + "line": 412, + "offset": 117, + "length": 5, + "code": { + "startLine": 410, + "length": 5, + "offset": 264, + "surroundingCode": " return f\"{bot.get_icon('progress.start_point', 'ST|')}\" \\\n f\"{bot.get_icon('progress.start_fill', 'SF|') * round(percentage * 10)}\" \\\n f\"{bot.get_icon('progress.mid_point', 'MP|') if percentage != 1 else bot.get_icon('progress.start_fill', 'SF|')}\" \\\n f\"{bot.get_icon('progress.end_fill', 'EF|') * round((1 - percentage) * 10)}\" \\\n f\"{bot.get_icon('progress.end', 'ED|') if percentage != 1 else bot.get_icon('progress.end_point', 'EP')}\"" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPep8Inspection" + }, + "hash": "1193e0955ccff5b2dbdc81145b0982066d94ecf5de17ec7357158f9049ccb9ae" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E501 line too long (126 \\> 120 characters)", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/source.py", + "language": "Python", + "line": 319, + "offset": 26, + "length": 101, + "code": { + "startLine": 317, + "length": 101, + "offset": 73, + "surroundingCode": "\n def check_query(self, query: str) -> bool:\n youtube_url_rx = r\"^(https?://(www\\.)?(youtube\\.com|music\\.youtube\\.com)/(watch\\?v=|playlist\\?list=)([a-zA-Z0-9_-]+))\"\n\n if re.match(youtube_url_rx, query):" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPep8Inspection" + }, + "hash": "24d5e21f04645740f75ff56a64dd6b000a3924497c9df20079721cb4a1a43eb7" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E501 line too long (127 \\> 120 characters)", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 841, + "offset": 118, + "length": 8, + "code": { + "startLine": 839, + "length": 8, + "offset": 207, + "surroundingCode": " await interaction.edit_original_response(\n embed=SuccessEmbed(\n f\"{self.bot.get_text('command.filters.removed', locale, '已移除效果器')}:{allowed_filters[filter_name].__name__}\"\n )\n )" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPep8Inspection" + }, + "hash": "4405d48ee1103a5c98b6f64228f22cfa68506aa9c8f66ffc3145c56fa4f1758b" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E501 line too long (165 \\> 120 characters)", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 212, + "offset": 117, + "length": 7, + "code": { + "startLine": 210, + "length": 7, + "offset": 190, + "surroundingCode": " embeds=[\n SuccessEmbed(\n title=f\"{self.bot.get_text('command.play.loaded.title', locale, '已加入播放序列')} {len(results.tracks)} / {results.playlist_info.name}\",\n description='\\n'.join(\n [" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPep8Inspection" + }, + "hash": "515bdeb46d9ef457a64ba671c2715b5c435514305c040ce7c90185b7ee3f4cb0" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E131 continuation line unaligned for hanging indent", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/utils.py", + "language": "Python", + "line": 353, + "offset": 19, + "length": 3, + "code": { + "startLine": 351, + "length": 3, + "offset": 152, + "surroundingCode": " ]\n ) + (f\"\\n{bot.get_text('display.queue.more', locale, '還有更多...')}\" if len(player.queue) > 5 else \"\")) or\n bot.get_text(\"empty\", locale, \"空\"),\n inline=True\n )" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyPep8Inspection" + }, + "hash": "5fca3442d7b1bf629ab1019144384538d008b1bb3ba673bc6980da9bf202740a" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "PEP 8 coding style violation", + "tags": [ + "Python" + ], + "severity": "Moderate", + "comment": "PEP 8: E501 line too long (193 \\> 120 characters)", + "detailsInfo": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool.", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 675, + "offset": 121, + "length": 4, + "code": { + "startLine": 673, + "length": 4, + "offset": 202, + "surroundingCode": " await interaction.edit_original_response(\n embed=SuccessEmbed(\n f\"{self.bot.get_text('command.shuffle.success', locale, '隨機播放模式')}:{self.bot.get_text('enable', locale, '開啟') if player.shuffle else self.bot.get_text('disable', locale, '關閉')}\"\n )\n )" } } ], "attributes": { "module": "project", - "inspectionName": "PyClassHasNoInitInspection" + "inspectionName": "PyPep8Inspection" }, - "hash": "be7606d77e92bcb99f2c7707d3c431b3ef89e217bc6015032fba692d52ca5bea" + "hash": "d1a2e4598c0bb84fe9fb4a1f22ad15e02a74cd8265da3ca49cb3730b3bd6a89a" },{ "tool": "Code Inspection", "category": "Python", @@ -246,4 +928,35 @@ "inspectionName": "PyUnusedLocalInspection" }, "hash": "da04a5cd4e65db71fdc174052f9f085a16ec32563813f4f883c2de9cc2d0e0ac" +},{ + "tool": "Code Inspection", + "category": "RegExp", + "type": "Unnecessary non-capturing group", + "tags": [ + "RegExp" + ], + "severity": "High", + "comment": "Unnecessary non-capturing group `(?:%[0-9a-fA-F][0-9a-fA-F])`", + "detailsInfo": "Reports unnecessary non-capturing groups, which have no influence on the match result.\n\n**Example:**\n\n\n Everybody be cool, (?:this) is a robbery!\n\nAfter the quick-fix is applied:\n\n\n Everybody be cool, this is a robbery!\n\nNew in 2021.1", + "sources": [ + { + "type": "file", + "path": "lava/cogs/commands.py", + "language": "Python", + "line": 685, + "offset": 72, + "length": 3, + "code": { + "startLine": 683, + "length": 3, + "offset": 187, + "surroundingCode": " @play.autocomplete(\"query\")\n async def search(self, interaction: ApplicationCommandInteraction, query: str):\n if re.match(r\"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+\", query):\n return []\n" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "RegExpUnnecessaryNonCapturingGroup" + }, + "hash": "bcc0433c069222049eaace56689a6744fbd639637b985a835f2687c976921e81" }]} \ No newline at end of file diff --git a/results/sanity.json b/results/sanity.json index c6a09e28..1d1d841c 100644 --- a/results/sanity.json +++ b/results/sanity.json @@ -1,345 +1,4 @@ {"version":"3","listProblem":[{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/utils.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 77, - "code": { - "startLine": 1, - "length": 77, - "offset": 0, - "surroundingCode": "import asyncio\nimport subprocess\nfrom typing import Union, Iterable, Optional\n\nimport youtube_related" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "0f2ae4d9ed418b29b9f57a32c4f2eb07ae60323307f25417e09d7a7fd84ae0cf" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/cogs/commands.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 32, - "code": { - "startLine": 1, - "length": 32, - "offset": 0, - "surroundingCode": "import re\nfrom os import getpid\n\nfrom disnake import Option, ApplicationCommandInteraction, OptionType, OptionChoice, ButtonStyle, Localized, Embed\nfrom disnake.ext import commands" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "34b4b5b7ebd58eccf9a05e7f09ece9f677a5525b95661150feb5e4b37f4002e9" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/bot.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 39, - "code": { - "startLine": 1, - "length": 39, - "offset": 0, - "surroundingCode": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "608446ec511e17c3e7634e044b01595f8c5a3d59fbd975e4815293dd13bc1cad" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "main.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 1874, - "code": { - "startLine": 1, - "length": 1874, - "offset": 0, - "surroundingCode": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r\n\r\nfrom lava.bot import Bot\r\n\r\n\r\ndef main():\r\n load_dotenv(\"stack.env\")\r\n\r\n setup_logging()\r\n\r\n main_logger = logging.getLogger(\"lava.main\")\r\n\r\n loop = asyncio.new_event_loop()\r\n\r\n bot = Bot(\r\n logger=main_logger,\r\n command_prefix=getenv(\"PREFIX\", \"l!\"), intents=Intents.all(), loop=loop,\r\n command_sync_flags=CommandSyncFlags.default()\r\n )\r\n\r\n bot.i18n.load(\"locale/\")\r\n\r\n load_extensions(bot)\r\n\r\n bot.run(os.environ[\"TOKEN\"])\r\n\r\n\r\ndef setup_logging():\r\n \"\"\"\r\n Set up the loggings for the bot\r\n :return: None\r\n \"\"\"\r\n formatter = ColoredFormatter(\r\n '%(asctime)s %(log_color)s [%(levelname)s] %(message)s',\r\n datefmt='%Y-%m-%d %H:%M:%S',\r\n log_colors={\r\n 'DEBUG': 'cyan',\r\n 'INFO': 'white',\r\n 'WARNING': 'yellow',\r\n 'ERROR': 'red',\r\n 'CRITICAL': 'bold_red',\r\n }\r\n )\r\n\r\n stream_handler = logging.StreamHandler()\r\n stream_handler.setLevel(logging.INFO)\r\n stream_handler.setFormatter(formatter)\r\n\r\n file_handler = logging.FileHandler(filename=\"lava.log\", encoding=\"utf-8\", mode=\"w\")\r\n file_handler.setLevel(logging.DEBUG)\r\n file_handler.setFormatter(formatter)\r\n\r\n logging.basicConfig(\r\n handlers=[stream_handler, file_handler], level=logging.INFO\r\n )\r\n\r\n\r\ndef load_extensions(bot: Bot) -> Bot:\r\n \"\"\"\r\n Load extensions in extensions.json file\r\n :param bot: The bot to load the extensions to\r\n :return: The bot\r\n \"\"\"\r\n with open(\"extensions.json\", \"r\") as f:\r\n extensions = json.load(f)\r\n\r\n for extension in extensions:\r\n bot.load_e" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "65041f2c4b132fbb8849787bfa455cd7d16e65f4f85a6d6de3321296f423575c" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/cogs/events.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 7344, - "code": { - "startLine": 1, - "length": 7344, - "offset": 0, - "surroundingCode": "from logging import getLogger\r\nfrom typing import Union\r\n\r\nfrom disnake import TextChannel, Thread, InteractionResponded, ApplicationCommandInteraction, \\\r\n MessageInteraction\r\nfrom disnake.abc import GuildChannel\r\nfrom disnake.ext import commands\r\nfrom disnake.ext.commands import Cog, CommandInvokeError\r\nfrom lavalink import TrackLoadFailedEvent, DefaultPlayer, PlayerUpdateEvent, TrackEndEvent, QueueEndEvent\r\n\r\nfrom lava.bot import Bot\r\nfrom lava.embeds import ErrorEmbed\r\nfrom lava.errors import MissingVoicePermissions, BotNotInVoice, UserNotInVoice, UserInDifferentChannel\r\nfrom lava.utils import get_recommended_tracks, update_display, ensure_voice, toggle_autoplay\r\n\r\n\r\nclass Events(Cog):\r\n def __init__(self, bot: Bot):\r\n self.bot = bot\r\n\r\n self.logger = getLogger(\"lava.events\")\r\n\r\n async def cog_load(self):\r\n await self.bot.wait_until_ready()\r\n\r\n @commands.Cog.listener(name=\"on_ready\")\r\n async def on_ready(self):\r\n self.bot.lavalink.add_event_hook(self.track_hook)\r\n\r\n async def track_hook(self, event):\r\n if isinstance(event, PlayerUpdateEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.debug(\"Received player update event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n if event.player.fetch(\"autoplay\") and len(event.player.queue) <= 5:\r\n self.logger.info(\r\n \"Queue is empty, adding recommended track for guild %s...\", self.bot.get_guild(player.guild_id)\r\n )\r\n\r\n recommendations = await get_recommended_tracks(player, player.current, 5 - len(player.queue))\r\n\r\n for recommendation in recommendations:\r\n event.player.add(requester=0, track=recommendation)\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received track end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, QueueEndEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n self.logger.info(\"Received queue end event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError:\r\n pass\r\n\r\n elif isinstance(event, TrackLoadFailedEvent):\r\n player: DefaultPlayer = event.player\r\n\r\n locale: str = str(player.fetch(\"locale\", \"zh_TW\"))\r\n\r\n self.logger.info(\"Received track load failed event for guild %s\", self.bot.get_guild(player.guild_id))\r\n\r\n # noinspection PyTypeChecker\r\n channel: Union[GuildChannel, TextChannel, Thread] = self.bot.get_channel(int(player.fetch(\"channel\")))\r\n\r\n message = await channel.send(\r\n embed=ErrorEmbed(\r\n f\"{self.bot.get_text('error.play_failed', locale, '無法播放歌曲')}: {event.track['title']}\",\r\n f\"{self.bot.get_text('reason', locale, '原因')}: `{event.original or 'Unknown'}`\"\r\n )\r\n )\r\n\r\n await player.skip()\r\n\r\n await update_display(self.bot, player, message, delay=5)\r\n\r\n @commands.Cog.listener(name=\"on_slash_command_error\")\r\n async def on_slash_command_error(self, interaction: ApplicationCommandInteraction, error: CommandInvokeError):\r\n locale = str(interaction.locale)\r\n\r\n if isinstance(error.original, MissingVoicePermissions):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.no_play_perms', locale, \"我需要 `連接` 和 `說話` 權限才能夠播放音樂\")\r\n )\r\n\r\n elif isinstance(error.original, BotNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.bot_not_in_voice', locale, \"我沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserNotInVoice):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n self.bot.get_text('error.user_not_in_voice', locale, \"你沒有連接到一個語音頻道\")\r\n )\r\n\r\n elif isinstance(error.original, UserInDifferentChannel):\r\n embed = ErrorEmbed(\r\n self.bot.get_text('error.command.title', locale, '指令錯誤'),\r\n f\"{self.bot.get_text('error.must_in_same_voice', locale, '你必須與我在同一個語音頻道')} <#{error.original.voice.id}>\"\r\n )\r\n\r\n else:\r\n raise error.original\r\n\r\n try:\r\n await interaction.response.send_message(embed=embed)\r\n except InteractionResponded:\r\n await interaction.edit_original_response(embed=embed)\r\n\r\n @commands.Cog.listener(name=\"on_voice_state_update\")\r\n async def on_voice_state_update(self, member, before, after):\r\n if (\r\n before.channel is not None\r\n and after.channel is None\r\n and member.id == self.bot.user.id\r\n ):\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(member.guild.id)\r\n\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n try:\r\n await update_display(self.bot, player)\r\n except ValueError: # There's no message to update\r\n pass\r\n\r\n @commands.Cog.listener(name=\"on_message_interaction\")\r\n async def on_message_interaction(self, interaction: MessageInteraction):\r\n if interaction.data.custom_id.startswith(\"control\"):\r\n if interaction.data.custom_id.startswith(\"control.empty\"):\r\n await interaction.response.edit_message()\r\n\r\n return\r\n\r\n try:\r\n await ensure_voice(interaction, should_connect=False)\r\n except (UserNotInVoice, BotNotInVoice, MissingVoicePermissions, UserInDifferentChannel):\r\n return\r\n\r\n player: DefaultPlayer = self.bot.lavalink.player_manager.get(interaction.guild_id)\r\n\r\n match interaction.data.custom_id:\r\n case \"control.resume\":\r\n await player.set_pause(False)\r\n\r\n case \"control.pause\":\r\n await player.set_pause(True)\r\n\r\n case \"control.stop\":\r\n await player.stop()\r\n player.queue.clear()\r\n\r\n case \"control.previous\":\r\n await player.seek(0)\r\n\r\n case \"control.next\":\r\n await player.skip()\r\n\r\n case \"control.shuffle\":\r\n player.set_shuffle(not player.shuffle)\r\n\r\n case \"control.repeat\":\r\n player.set_loop(player.loop + 1 if player.loop < 2 else 0)\r\n\r\n case \"control.rewind\":\r\n await player.seek(round(player.position) - 10000)\r\n\r\n case \"control.forward\":\r\n await player.seek(round(player.position) + 10000)\r\n\r\n case " - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "6bb4836a3a1f496045060ed686569634a7f28b983597c6e5b78ccd342850a3d3" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/source.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 51, - "code": { - "startLine": 1, - "length": 51, - "offset": 0, - "surroundingCode": "import json\nimport re\nfrom logging import getLogger\nfrom os import getenv\nfrom typing import Union, Tuple, Optional" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "82b2eb7ec5274df8edb99a9eb41dfffec6c0a161b97dca97a72a0b4d0d8906ce" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/errors.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 37, - "code": { - "startLine": 1, - "length": 37, - "offset": 0, - "surroundingCode": "from disnake.abc import Connectable\n\n\nclass UserNotInVoice(Exception):\n pass" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "83fdd9baa341ec764dcb50b4791639640ddc7fc31a611e4b24494139193e5667" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/variables.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 114, - "code": { - "startLine": 1, - "length": 114, - "offset": 0, - "surroundingCode": "class Variables:\n \"\"\"A class contains static variables for this bot\"\"\"\n SPOTIFY_CLIENT = \"SPOTIFY_CLIENT_ID\"\n" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "920ee80fcb895ece91d14b1b57f0dbec728ee53609a9bc96e5d4dec713bd62a2" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/voice_client.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 110, - "code": { - "startLine": 1, - "length": 110, - "offset": 0, - "surroundingCode": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n\nfrom lava.bot import Bot" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "b1402f2443407a2a86084f53ef71344806ebcafa2936c15f2aab8eecd7f20a4f" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "An invalid interpreter", - "tags": [ - "Sanity" - ], - "severity": "High", - "comment": "No Python interpreter configured for the project", - "detailsInfo": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings.", - "sources": [ - { - "type": "file", - "path": "lava/embeds.py", - "language": "Python", - "line": 1, - "offset": 1, - "length": 62, - "code": { - "startLine": 1, - "length": 62, - "offset": 0, - "surroundingCode": "from typing import Union\n\nfrom disnake import Embed, Localized\n\n" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyInterpreterInspection" - }, - "hash": "c04f38b138402afbe6b8f4f15ae4a25ca7b4d2f4c9db87ebba038a7f03c51891" -},{ - "tool": "Code Inspection", - "category": "Python", - "type": "Unresolved references", - "tags": [ - "Sanity" - ], - "severity": "Critical", - "comment": "Unresolved reference 'Exception'", - "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", - "sources": [ - { - "type": "file", - "path": "lava/errors.py", - "language": "Python", - "line": 8, - "offset": 21, - "length": 9, - "code": { - "startLine": 6, - "length": 9, - "offset": 22, - "surroundingCode": "\n\nclass BotNotInVoice(Exception):\n pass\n" - } - } - ], - "attributes": { - "module": "project", - "inspectionName": "PyUnresolvedReferencesInspection" - }, - "hash": "22403c00f7e6a62353763b95245de8547295865f9e6356f3a8c7b28e27804a37" -},{ "tool": "Code Inspection", "category": "Python", "type": "Unresolved references", @@ -347,21 +6,21 @@ "Sanity" ], "severity": "Critical", - "comment": "No module named 'asyncio'", + "comment": "Unresolved reference 'disnake'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", "path": "main.py", "language": "Python", - "line": 1, - "offset": 8, + "line": 8, + "offset": 6, "length": 7, "code": { - "startLine": 1, + "startLine": 6, "length": 7, - "offset": 7, - "surroundingCode": "import asyncio\r\nimport json\r\nimport logging\r" + "offset": 46, + "surroundingCode": "\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r" } } ], @@ -369,7 +28,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "3ff10b8c1a10e77b931f14ff44714dd87ad826f3f8e4b8c47a3dca5402298cb1" + "hash": "36b78d35da92927826a0f2e3b4c11811cf22fcac61558f8d3d5e09ee4f4a9ec6" },{ "tool": "Code Inspection", "category": "Python", @@ -440,21 +99,21 @@ "Sanity" ], "severity": "Critical", - "comment": "No module named 'os'", + "comment": "Unresolved reference 'Source'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "main.py", + "path": "lava/source.py", "language": "Python", - "line": 4, - "offset": 8, - "length": 2, + "line": 9, + "offset": 22, + "length": 6, "code": { - "startLine": 2, - "length": 2, - "offset": 36, - "surroundingCode": "import json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r\n\r" + "startLine": 7, + "length": 6, + "offset": 67, + "surroundingCode": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" } } ], @@ -462,7 +121,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "530ea58751d98cf03e716370c6d03fb8108a1a384171be6327963a8b310ca150" + "hash": "558653979545d7d2f6618222402bc4cc6d2cd11a47c484188e8844d112040f71" },{ "tool": "Code Inspection", "category": "Python", @@ -471,21 +130,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'disnake'", + "comment": "Unresolved reference 'BeautifulSoup'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/bot.py", + "path": "lava/source.py", "language": "Python", - "line": 4, - "offset": 6, - "length": 7, + "line": 8, + "offset": 17, + "length": 13, "code": { - "startLine": 2, - "length": 7, + "startLine": 6, + "length": 13, "offset": 33, - "surroundingCode": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" + "surroundingCode": "\nimport requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials" } } ], @@ -493,7 +152,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "56f04ef5cde4350c9ca6b392982da630abe437059ac4e7ffab8555cea03664ec" + "hash": "569053e57a7f4ce5251c171c9d5813c629b82ea3ebbe920cf581687bf2e8b5a5" },{ "tool": "Code Inspection", "category": "Python", @@ -502,21 +161,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'Union'", + "comment": "Unresolved reference 'disnake'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/embeds.py", + "path": "lava/bot.py", "language": "Python", - "line": 1, - "offset": 20, - "length": 5, + "line": 4, + "offset": 6, + "length": 7, "code": { - "startLine": 1, - "length": 5, - "offset": 19, - "surroundingCode": "from typing import Union\n\nfrom disnake import Embed, Localized" + "startLine": 2, + "length": 7, + "offset": 33, + "surroundingCode": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" } } ], @@ -524,7 +183,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "635fb084d35f67b8583629eb3da8f9ae9acfc7fc6c115a4ab2de487ceaf5cbdb" + "hash": "56f04ef5cde4350c9ca6b392982da630abe437059ac4e7ffab8555cea03664ec" },{ "tool": "Code Inspection", "category": "Python", @@ -564,21 +223,21 @@ "Sanity" ], "severity": "Critical", - "comment": "No module named 'json'", + "comment": "Unresolved reference 'MISSING'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "main.py", + "path": "lava/bot.py", "language": "Python", - "line": 2, - "offset": 8, - "length": 4, + "line": 4, + "offset": 25, + "length": 7, "code": { - "startLine": 1, - "length": 4, - "offset": 23, - "surroundingCode": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r" + "startLine": 2, + "length": 7, + "offset": 52, + "surroundingCode": "from logging import Logger\n\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client" } } ], @@ -586,7 +245,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "76c9538e4faafc3f46f3476f2b2445c32b5cc929543090824ea48be424e85de0" + "hash": "74360414930cea80a9b41d4dabfb02cf767943240d0e42fb8b4e9d2a9749b1bb" },{ "tool": "Code Inspection", "category": "Python", @@ -595,21 +254,21 @@ "Sanity" ], "severity": "Critical", - "comment": "No module named 'logging'", + "comment": "Unresolved reference 'lavalink'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "main.py", + "path": "lava/voice_client.py", "language": "Python", - "line": 3, - "offset": 8, - "length": 7, + "line": 2, + "offset": 6, + "length": 8, "code": { "startLine": 1, - "length": 7, - "offset": 36, - "surroundingCode": "import asyncio\r\nimport json\r\nimport logging\r\nimport os\r\nfrom os import getenv\r" + "length": 8, + "offset": 51, + "surroundingCode": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" } } ], @@ -617,7 +276,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "7d9905cd6424abd8a427065088b2e6c0a15606218f4f9a7006004db21a660309" + "hash": "84ea173295f4f3aee284ad09db79ba824eccb3016b6f2e0699aeba72f3cb3b99" },{ "tool": "Code Inspection", "category": "Python", @@ -626,21 +285,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'lavalink'", + "comment": "Unresolved reference 'bs4'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/voice_client.py", + "path": "lava/source.py", "language": "Python", - "line": 2, + "line": 8, "offset": 6, - "length": 8, + "length": 3, "code": { - "startLine": 1, - "length": 8, - "offset": 51, - "surroundingCode": "from disnake import VoiceClient, VoiceChannel\nfrom lavalink import DefaultPlayer\nfrom disnake.utils import get\n" + "startLine": 6, + "length": 3, + "offset": 22, + "surroundingCode": "\nimport requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials" } } ], @@ -648,7 +307,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "84ea173295f4f3aee284ad09db79ba824eccb3016b6f2e0699aeba72f3cb3b99" + "hash": "8f55e0ba549841996971a8cb8c9a826762b7a2003061dfc20b25ca1573c2b753" },{ "tool": "Code Inspection", "category": "Python", @@ -688,21 +347,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'logging'", + "comment": "Unresolved reference 'ColoredFormatter'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/bot.py", + "path": "main.py", "language": "Python", - "line": 2, - "offset": 6, - "length": 7, + "line": 7, + "offset": 22, + "length": 16, "code": { - "startLine": 1, - "length": 7, - "offset": 17, - "surroundingCode": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING" + "startLine": 5, + "length": 16, + "offset": 46, + "surroundingCode": "from os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r" } } ], @@ -710,7 +369,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "9b0e0f5e4476e44ffde08b245a121f682e6619dd90c409521e1a0141aa8818a5" + "hash": "b7cb1fba0fed10cdd8f1fc797e84a1b3793b0b66f03718fd40f9ea4931049e2a" },{ "tool": "Code Inspection", "category": "Python", @@ -719,21 +378,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'Exception'", + "comment": "Unresolved reference 'Bot'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/errors.py", + "path": "lava/bot.py", "language": "Python", - "line": 4, - "offset": 22, - "length": 9, + "line": 5, + "offset": 34, + "length": 3, "code": { - "startLine": 2, - "length": 9, - "offset": 23, - "surroundingCode": "\n\nclass UserNotInVoice(Exception):\n pass\n" + "startLine": 3, + "length": 3, + "offset": 66, + "surroundingCode": "\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n" } } ], @@ -741,7 +400,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "ca1cb7e1a451961ee2a844f0baef086fb085591584ccd185e9afde69be4fb8bf" + "hash": "cb1dd8b4f4b8779d0ff673bcf0696cc136b9393ddc2e5d2d5ca4706cc2db3e08" },{ "tool": "Code Inspection", "category": "Python", @@ -750,21 +409,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'Logger'", + "comment": "Unresolved reference 'Intents'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/bot.py", + "path": "main.py", "language": "Python", - "line": 2, + "line": 8, "offset": 21, - "length": 6, + "length": 7, "code": { - "startLine": 1, - "length": 6, - "offset": 32, - "surroundingCode": "import json\nfrom logging import Logger\n\nfrom disnake.abc import MISSING" + "startLine": 6, + "length": 7, + "offset": 61, + "surroundingCode": "\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r\nfrom dotenv import load_dotenv\r" } } ], @@ -772,7 +431,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "cc7097b4f547688980830e6e1610da0e65fb7a7a0bcf81cea4118582ee8c3f71" + "hash": "e364f17e4dcb99fec398835367023a76b62b48f178f5f28d0e17996ddc7514cd" },{ "tool": "Code Inspection", "category": "Python", @@ -781,21 +440,21 @@ "Sanity" ], "severity": "Critical", - "comment": "Unresolved reference 'typing'", + "comment": "Unresolved reference 'colorlog'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", - "path": "lava/embeds.py", + "path": "main.py", "language": "Python", - "line": 1, + "line": 7, "offset": 6, - "length": 6, + "length": 8, "code": { - "startLine": 1, - "length": 6, - "offset": 5, - "surroundingCode": "from typing import Union\n\nfrom disnake import Embed, Localized" + "startLine": 5, + "length": 8, + "offset": 30, + "surroundingCode": "from os import getenv\r\n\r\nfrom colorlog import ColoredFormatter\r\nfrom disnake import Intents\r\nfrom disnake.ext.commands import CommandSyncFlags\r" } } ], @@ -803,7 +462,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "e3afe4f0cf4eab8da3ebb16df156d41fb669caceffaea96bc441a8ac6acb113c" + "hash": "e686808a889fc7f84fb1d6055711729084ec3f616a6d5926b0b9181850a97f90" },{ "tool": "Code Inspection", "category": "Python", @@ -843,21 +502,21 @@ "Sanity" ], "severity": "Critical", - "comment": "No module named 'json'", + "comment": "Unresolved reference 'disnake'", "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", "sources": [ { "type": "file", "path": "lava/bot.py", "language": "Python", - "line": 1, - "offset": 8, - "length": 4, + "line": 5, + "offset": 6, + "length": 7, "code": { - "startLine": 1, - "length": 4, - "offset": 7, - "surroundingCode": "import json\nfrom logging import Logger\n" + "startLine": 3, + "length": 7, + "offset": 38, + "surroundingCode": "\nfrom disnake.abc import MISSING\nfrom disnake.ext.commands import Bot as OriginalBot\nfrom lavalink import Client\n" } } ], @@ -865,7 +524,7 @@ "module": "project", "inspectionName": "PyUnresolvedReferencesInspection" }, - "hash": "f6158208da390ef9c169759c4e651ff041a971c724d9b413c3f6d07cda187566" + "hash": "f92fbf30f13a1f4b731dfd48f2a8820215cf4460c4d8c06e82ea180e05436d38" },{ "tool": "Code Inspection", "category": "Python", @@ -928,4 +587,35 @@ "inspectionName": "PyUnresolvedReferencesInspection" }, "hash": "fd599dc346cc1dc6a889926cf99b7d7d5e5b9aceddce3a34df501e1738c86bf4" +},{ + "tool": "Code Inspection", + "category": "Python", + "type": "Unresolved references", + "tags": [ + "Sanity" + ], + "severity": "Critical", + "comment": "Unresolved reference 'lavalink'", + "detailsInfo": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly.", + "sources": [ + { + "type": "file", + "path": "lava/source.py", + "language": "Python", + "line": 9, + "offset": 6, + "length": 8, + "code": { + "startLine": 7, + "length": 8, + "offset": 51, + "surroundingCode": "import requests\nfrom bs4 import BeautifulSoup\nfrom lavalink import Source, Client, LoadResult, LoadType, PlaylistInfo, DeferredAudioTrack\nfrom spotipy import Spotify, SpotifyClientCredentials\nfrom yt_dlp import YoutubeDL" + } + } + ], + "attributes": { + "module": "project", + "inspectionName": "PyUnresolvedReferencesInspection" + }, + "hash": "ffc795f612442c3bec41d08e0735ac11693f194c514422842dbb31abeb9bb3c0" }]} \ No newline at end of file