include/lib/swiftmailer/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php
File NTLMAuthenticator.php
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
Swift_Transport_Esmtp_Auth_NTLMAuthenticator
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Esmtp_Authenticator
{
const NTLMSIG = "NTLMSSP\x00";
const DESCONST = "KGS!@#$%";
Method debug
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function debug($message)
{
$message = bin2hex($message);
$messageId = substr($message, 16, 8);
echo substr($message, 0, 16) . " NTLMSSP Signature<br />\n";
Function si2bin
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function si2bin($si, $bits = 32)
{
$bin = null;
if ($si >= -pow(2, $bits - 1) && ($si <= pow(2, $bits - 1))) {
// positive or zero
- Read upRead up
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 sendMessage3
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function sendMessage3($response, $username, $password, $timestamp, $client, Swift_Transport_SmtpAgent $agent, $v2 = true)
Method createNTLMv2Hash
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function createNTLMv2Hash($password, $username, $domain, $challenge, $targetInfo, $timestamp, $client)
Method createLMv2Password
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function createLMv2Password($password, $username, $domain, $challenge, $client)
Method createMessage3
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function createMessage3($domain, $username, $workstation, $lmResponse, $ntlmResponse)
Function debug
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function debug($message)
{
$message = bin2hex($message);
$messageId = substr($message, 16, 8);
echo substr($message, 0, 16) . " NTLMSSP Signature<br />\n";
- Read upRead up
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"