digitalbiblesociety/dbp

View on GitHub

Showing 67 of 67 total issues

Function seedLexicalDefinitions has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    private function seedLexicalDefinitions($lex, $word_letter)
    {
        $known_keys = collect(['def', 'deriv', 'pronun', 'see', 'comment', 'aramaic', 'id', 'strongs', 'base_word', 'data', 'usage', 'part_of_speech']);

        if(!collect($lex)->keys()->diff($known_keys)->isEmpty()) {
Severity: Minor
Found in database/seeds/SeedBibleStrongs.php - About 5 hrs 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 update has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($id)
    {
        $bible = Bible::find($id);

        request()->validate([
Severity: Minor
Found in app/Http/Controllers/User/Dashboard/BibleManagementController.php - About 3 hrs 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 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle()
    {
        $update_count = 0;
        $bible_links = BibleLink::where('organization_id', null)->get();
        $organization_translations = OrganizationTranslation::all();

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

Language has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class Language extends Model
{
    protected $connection = 'dbp';
    public $table = 'languages';
    //protected $hidden = ['pivot'];
Severity: Minor
Found in app/Models/Language/Language.php - About 3 hrs to fix

    Function handle has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        public function handle()
        {
            $root_path = "http://www.beblia.com/pages/";
            // MainContent_chapterForwardButton
    
    
    Severity: Minor
    Found in app/Console/Commands/BibleEquivalents/SyncBebliaBible.php - About 3 hrs 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

    User has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class User extends Authenticatable
    {
        use Notifiable;
        use SoftDeletes;
    
    
    Severity: Minor
    Found in app/Models/User/User.php - About 2 hrs to fix

      Function handle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle()
          {
              $user = User::where('email', config('app.contact'))->first();
              $response = \Cache::remember('ibt_russian_bibles', now()->addMonth(), function () {
                  return json_decode(file_get_contents('http://ibt.org.ru/sites/default/files/media_manifest.json'));
      Severity: Minor
      Found in app/Console/Commands/BibleEquivalents/SyncIBT.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 handle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle()
          {
      
              $string_html = file_get_contents('http://scriptsource.org/cms/scripts/page.php?item_id=script_overview');
              $dom = HtmlDomParser::str_get_html($string_html);
      Severity: Minor
      Found in app/Console/Commands/Wiki/SyncAlphabets.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 run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              $permission_types = [ 'mobile', 'download', 'download_text', 'web', 'web_streaming', 'sign_language', 'local_bundled', 'podcast', 'mp3_cd', 'streaming_url', 'developer', 'radio', 'television', 'digital_download', 'bible_stick', 'subsplash', 'lo_res', 'med_res', 'hi_res', 'is_right_to_left', 'num_art', 'num_sample_audio', 'organization_id', 'tlibrary_id', 'stocknumber'];
      
              $dam_volumes = \DB::connection('dbp_v2')->table('dam_library')->get();
      Severity: Minor
      Found in database/seeds/seedFilesetTags.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 checkParam has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function checkParam(string $paramName, $required = false, $inPathValue = null)
      {
          // Path params
          if ($inPathValue) {
              return $inPathValue;
      Severity: Minor
      Found in app/Helpers/Helpers.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 parseVerses has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          private function parseVerses($bible_file_path, $language)
          {
              $output_path = storage_path('data/bibles/getbible/usfm/'.basename($bible_file_path,'.txt'));
              if(!file_exists($output_path)) {
                  mkdir($output_path);
      Severity: Minor
      Found in app/Console/Commands/BibleFormats/FormatGetBible.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 transformForV4 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transformForV4($bible)
          {
      
              switch ($this->route) {
      
      
      Severity: Minor
      Found in app/Transformers/BibleTransformer.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 login has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function login(Request $request)
          {
              if (!$this->api && $request->method() !== 'POST') {
                  return view('auth.login');
              }
      Severity: Minor
      Found in app/Http/Controllers/User/UsersController.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 handle has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle()
          {
      
              // Base Paths
              $base_iso2 = 'fr';
      Severity: Minor
      Found in app/Console/Commands/Wiki/SyncLanguageDescriptions.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 addPeopleNames has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function addPeopleNames($people): void
          {
              foreach ($people as $person) {
                  foreach ($person->names as $name) {
                      $person_name = GlossaryPersonName::create([
      Severity: Minor
      Found in app/Console/Commands/StudyFormats/fetchTyndalePeople.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 csvToArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          function csvToArray($csvfile)
          {
              $csv      = [];
              $rowcount = 0;
              if (($handle = fopen($csvfile, 'r')) !== false) {
      Severity: Minor
      Found in app/Helpers/Helpers.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 phpInfo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function phpInfo()
          {
              // Generate array from php info
              ob_start();
              phpinfo(INFO_MODULES);
      Severity: Minor
      Found in app/Http/Controllers/User/Dashboard/AdminDetailsController.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 run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              ini_set('memory_limit', '4000M');
      
              $filesets = BibleFileset::where('set_type_code', 'text_plain')->get();
      Severity: Minor
      Found in database/seeds/SeedBibleText.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 swaggerVersionPaths has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private function swaggerVersionPaths($paths, $version)
          {
              foreach ($paths as $key => $path) {
                  if (isset($path->get->operationId) && !Str::startsWith($path->get->operationId, $version)) {
                      unset($paths[$key]);
      Severity: Minor
      Found in app/Http/Controllers/User/SwaggerDocsController.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 exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (current, length, displayLength) {
          if (length <= 1) return []
          displayLength = displayLength - 2
          var indexes = [1]
          var start = Math.round(current - displayLength / 2)
      Severity: Minor
      Found in resources/assets/js/components/bulma/paging.js - 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

      Severity
      Category
      Status
      Source
      Language