bcit-ci/CodeIgniter

View on GitHub
system/libraries/Ftp.php

Summary

Maintainability
C
1 day
Test Coverage

File Ftp.php has 305 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP
Severity: Minor
Found in system/libraries/Ftp.php - About 3 hrs to fix

    Function mirror has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function mirror($locpath, $rempath)
        {
            if ( ! $this->_is_conn())
            {
                return FALSE;
    Severity: Minor
    Found in system/libraries/Ftp.php - 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 delete_dir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function delete_dir($filepath)
        {
            if ( ! $this->_is_conn())
            {
                return FALSE;
    Severity: Minor
    Found in system/libraries/Ftp.php - 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

    Method upload has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
        {
            if ( ! $this->_is_conn())
            {
                return FALSE;
    Severity: Minor
    Found in system/libraries/Ftp.php - About 1 hr to fix

      Method mirror has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function mirror($locpath, $rempath)
          {
              if ( ! $this->_is_conn())
              {
                  return FALSE;
      Severity: Minor
      Found in system/libraries/Ftp.php - About 1 hr to fix

        Function connect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function connect($config = array())
            {
                if (count($config) > 0)
                {
                    $this->initialize($config);
        Severity: Minor
        Found in system/libraries/Ftp.php - About 45 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

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

            public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
            {
                if ( ! $this->_is_conn())
                {
                    return FALSE;
        Severity: Minor
        Found in system/libraries/Ftp.php - 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