Ephigenia/franklin

View on GitHub

Showing 9 of 9 total issues

Method report has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function report()
    {
        \Franklin\view\View::$baseDir = FRANKLIN_ROOT.'/view/';
        $action = 'report';
        if (isset($_GET['action'])) {
Severity: Minor
Found in lib/franklin/Franklin.php - About 1 hr to fix

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

        public function report()
        {
            \Franklin\view\View::$baseDir = FRANKLIN_ROOT.'/view/';
            $action = 'report';
            if (isset($_GET['action'])) {
    Severity: Minor
    Found in lib/franklin/Franklin.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 runTests has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function runTests(Array $filter = array())
        {
            $startTimestamp = time();
            $counters = array(
                'tests' => 0,
    Severity: Minor
    Found in lib/franklin/Franklin.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 parse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function parse($rawData)
        {
            // extract status code from message
            if (preg_match('@^HTTP(\/1(\.[10])?)?\s(\d+)@', $rawData, $found)) {
                $this->status = (int) $found[3];
    Severity: Minor
    Found in lib/franklin/network/HTTPResponse.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 checkHash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      function checkHash($hashNumber)
      {
          $check = 0;
        $flag = 0;
    
    
    Severity: Minor
    Found in lib/GooglePageRankChecker/GooglePageRankChecker.php - About 55 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 getLastNLines has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getLastNLines($count)
        {
            if (!$this->isReadable()) {
                return false;
            }
    Severity: Minor
    Found in lib/franklin/storage/CSV.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

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

        public function __construct($name, $config)
        {
            $this->name = $name;
            $this->config = $config;
            if (isset($this->config['tests'])) foreach($this->config['tests'] as $testConfig) {
    Severity: Minor
    Found in lib/franklin/Group.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

    Function check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      public function check($page) {
    
        // Open a socket to the toolbarqueries address, used by Google Toolbar
        $socket = fsockopen("toolbarqueries.google.com", 80, $errno, $errstr, 30);
    
    
    Severity: Minor
    Found in lib/GooglePageRankChecker/GooglePageRankChecker.php - About 25 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 findTestById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function findTestById($id)
        {
            foreach($this->groups as $Group) {
                foreach($Group as $Test) {
                    if ($Test->uniqueId() == $id) {
    Severity: Minor
    Found in lib/franklin/Franklin.php - About 25 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

    Severity
    Category
    Status
    Source
    Language