mrDoctorWho/vk4xmpp

View on GitHub
library/vkapi.py

Summary

Maintainability
D
2 days
Test Coverage

Function method has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    def method(self, method, values=None, notoken=False):
        """
        Executes a VK method
        Args:
            method: vk method
Severity: Minor
Found in library/vkapi.py - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File vkapi.py has 427 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf-8
# © simpleApps, 2013 — 2016.

"""
Manages VK API requests
Severity: Minor
Found in library/vkapi.py - About 6 hrs to fix

    Function repeat has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def repeat(maxRetries, resultType, *errors):
        """
        Tries to execute function ignoring specified errors specified number of
        times and returns specified result type on try limit.
        """
    Severity: Minor
    Found in library/vkapi.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function confirm has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def confirm(self):
            """
            Confirms the application and receives the token
            """
            url = "https://oauth.vk.com/authorize/"
    Severity: Minor
    Found in library/vkapi.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def login(self):
            """
            Logging in using password
            """
            url = "https://login.vk.com/"
    Severity: Minor
    Found in library/vkapi.py - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    There are no issues that match your filters.

    Category
    Status