os3/fs/file.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function readlines has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def readlines(self, n=None, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True,
Severity: Major
Found in os3/fs/file.py - About 1 hr to fix

    Function readline has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def readline(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None,
    Severity: Major
    Found in os3/fs/file.py - About 1 hr to fix

      Function read has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def read(self, n=None, mode=None, buffering=-1, encoding=None, errors=None, newline=None, closefd=True,
      Severity: Major
      Found in os3/fs/file.py - About 1 hr to fix

        Function write has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def write(self, data, mode=None, buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None):
        Severity: Major
        Found in os3/fs/file.py - About 1 hr to fix

          Function _get_open has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _get_open(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None):
          Severity: Major
          Found in os3/fs/file.py - About 50 mins to fix

            Function open has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def open(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None):
            Severity: Major
            Found in os3/fs/file.py - About 50 mins to fix

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

                  def readlines(self, n=None, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True,
                                opener=None, breaklines=True):
                      if n is not None and not isinstance(n, int):
                          mode = n
                          n = 0
              Severity: Minor
              Found in os3/fs/file.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