digitalbiblesociety/dbp

View on GitHub

Showing 67 of 67 total issues

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

    private function generateFilesetChapters($fileset, $fileset_chapters, $bible, $asset_id)
    {
        if ($fileset->set_type_code === 'video_stream') {
            foreach ($fileset_chapters as $key => $fileSet_chapter) {
                $fileset_chapters[$key]->file_name = route('v4_video_stream', ['fileset_id' => $fileset->id, 'file_id' => $fileSet_chapter->id]);
Severity: Minor
Found in app/Http/Controllers/Bible/BibleFileSetsController.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 user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function user()
    {
        if (request()->getMethod() === 'POST') {
            $user = $user = User::where('email', request()->email)->first();
            if (!$user) {
Severity: Minor
Found in app/Http/Controllers/User/UsersControllerV2.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 loadWorldFacts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function loadWorldFacts($country)
    {
        $loadedProfiles = [];

        // World Factbook
Severity: Minor
Found in app/Http/Controllers/Wiki/CountriesController.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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle()
    {
        // Find and delete current
        $apps = \Cache::remember('fcbh_apk_list', 1600, function () {
            $app = [];
Severity: Minor
Found in app/Console/Commands/BibleEquivalents/SyncFcbhApk.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 hslToRgb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function hslToRgb($hue, $saturation, $lightness)
    {
        $c = (1 - abs(2 * $lightness - 1)) * $saturation;
        $x = $c * (1 - abs(fmod($hue / 60, 2) - 1));
        $m = $lightness - ($c / 2);
Severity: Minor
Found in app/Http/Controllers/User/HighlightsController.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 store has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function store(Request $request)
    {
        $invalid = $this->validateUser();
        if ($invalid) {
            return $invalid;
Severity: Minor
Found in app/Http/Controllers/User/UsersController.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 sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function sync()
    {
        set_time_limit(0);
        ini_set('memory_limit', '500M');
        $storage = Storage::disk('data');
Severity: Minor
Found in app/Console/Commands/Resources/SyncGlobalRecordingsNetwork.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