Showing 27 of 49 total issues
Function checkUserIsCompletedScorm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function checkUserIsCompletedScorm($scormId, $userId)
{
$completedSco = [];
$scos = ScormScoModel::where('scorm_id', $scormId)->get();
- 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
Function __t
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)
{
if (Lang::has($key, $locale)) {
return __($key, $replace, $locale);
}
- 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
Function convertTimeInHundredth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function convertTimeInHundredth($time)
{
if ($time != null) {
$timeInArray = explode(':', $time);
$timeInArraySec = explode('.', $timeInArray[2]);
- 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
Avoid too many return
statements within this method. Open
return Session::flash($status_title, $message);
Avoid too many return
statements within this method. Open
return [
'success' => true,
'vars' => [
'DB_DATABASE' => $username,
'DB_USERNAME' => $username,
Avoid too many return
statements within this method. Open
return [
'success' => $bucket->success && $policy->success && $user->success,
'vars' => [
'AWS_ACCESS_KEY_ID' => $bucket_name,
'AWS_SECRET_ACCESS_KEY' => $password,
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$courses = Course::with('lessons')->get();
$contents = H5PContent::with('library')->get();
$scormScos = ScormScoModel::all();
- 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"