ampache/ampache

View on GitHub

Showing 25,690 of 25,690 total issues

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

},{"./frame":4,"./header":5,"./tables":14,"./utils":15}],11:[function(require,module,exports){
(function (global){
var AV = (typeof window !== "undefined" ? window['AV'] : typeof global !== "undefined" ? global['AV'] : null);
var tables = require('./tables');
var MP3FrameHeader = require('./header');
Severity: Minor
Found in public/lib/modules/aurora.js/mp3.js - About 2 wks 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

File aac.js has 3970 lines of code (exceeds 500 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
var AV = (typeof window !== "undefined" ? window['AV'] : typeof global !== "undefined" ? global['AV'] : null);
var tables = require('./tables');

Severity: Major
Found in public/lib/modules/aurora.js/aac.js - About 1 wk to fix

    File mp3.js has 3607 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
    exports.MP3Demuxer = require('./src/demuxer');
    exports.MP3Decoder = require('./src/decoder');
    
    },{"./src/decoder":2,"./src/demuxer":3}],2:[function(require,module,exports){
    Severity: Major
    Found in public/lib/modules/aurora.js/mp3.js - About 1 wk to fix

      File aurora.js has 3404 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AV = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
      // Generated by CoffeeScript 1.12.7
      (function() {
        var Asset, BufferSource, Decoder, Demuxer, EventEmitter, FileSource, HTTPSource,
          bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
      Severity: Major
      Found in public/lib/modules/aurora.js/aurora.js - About 1 wk to fix

        File jquery.jplayer.js has 3043 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        /**
         * FORKED BY AMPACHE 2022-02-01
         * USING LAST UPDATED GIT VERSION (https://github.com/jplayer/jPlayer)
         * https://github.com/jplayer/jPlayer/blob/master/dist/jplayer/jquery.jplayer.js
         */
        Severity: Major
        Found in public/lib/modules/jplayer/jquery.jplayer.js - About 1 wk to fix

          File Catalog.php has 2953 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          <?php
          
          declare(strict_types=0);
          
          /**
          Severity: Major
          Found in src/Repository/Model/Catalog.php - About 1 wk to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            <?php
            
            declare(strict_types=0);
            
            /**
            Severity: Major
            Found in src/Module/Api/Method/PlaylistGenerateMethod.php and 1 other location - About 1 wk to fix
            src/Module/Api/Method/Api5/PlaylistGenerate5Method.php on lines 1..197

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 1291.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            <?php
            
            declare(strict_types=0);
            
            /**
            Severity: Major
            Found in src/Module/Api/Method/Api5/PlaylistGenerate5Method.php and 1 other location - About 1 wk to fix
            src/Module/Api/Method/PlaylistGenerateMethod.php on lines 1..198

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 1291.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function 4 has a Cognitive Complexity of 331 (exceeds 5 allowed). Consider refactoring.
            Open

            },{"./ics":8}],4:[function(require,module,exports){
            (function (global){
            /*
             * AAC.js - Advanced Audio Coding decoder in JavaScript
             * Created by Devon Govett
            Severity: Minor
            Found in public/lib/modules/aurora.js/aac.js - About 6 days 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 7 has 1444 lines of code (exceeds 200 allowed). Consider refactoring.
            Open

            },{"./ics":8,"./mdct":9}],7:[function(require,module,exports){
            /*
             * AAC.js - Advanced Audio Coding decoder in JavaScript
             * Created by Devon Govett
             * Copyright (c) 2012, Official.fm Labs
            Severity: Major
            Found in public/lib/modules/aurora.js/aac.js - About 6 days to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              const HCB10 = [
                  [4, 0, 1, 1],
                  [4, 1, 1, 2],
                  [4, 2, 2, 1],
                  [5, 6, 2, 2],
              Severity: Major
              Found in public/lib/modules/aurora.js/aac.js and 1 other location - About 6 days to fix
              public/lib/modules/aurora.js/aac.js on lines 1835..2005

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 1022.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              const HCB9 = [
                  [1, 0, 0, 0],
                  [3, 4, 1, 0],
                  [3, 5, 0, 1],
                  [4, 12, 1, 1],
              Severity: Major
              Found in public/lib/modules/aurora.js/aac.js and 1 other location - About 6 days to fix
              public/lib/modules/aurora.js/aac.js on lines 2007..2177

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 1022.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function run has a Cognitive Complexity of 292 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function run(ServerRequestInterface $request, GuiGatekeeperInterface $gatekeeper): ?ResponseInterface
                  {
                      //$this->logger->debug(print_r(apache_request_headers(), true), [LegacyLogger::CONTEXT_TYPE => __CLASS__]);
                      ob_end_clean();
              
              
              Severity: Minor
              Found in src/Module/Application/Playback/PlayAction.php - About 6 days 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 289 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function run(ServerRequestInterface $request, GuiGatekeeperInterface $gatekeeper): ?ResponseInterface
                  {
                      //$this->logger->debug(print_r(apache_request_headers(), true), [LegacyLogger::CONTEXT_TYPE => __CLASS__]);
                      ob_end_clean();
              
              
              Severity: Minor
              Found in src/Module/Application/Playback/Play2Action.php - About 5 days 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 2 has a Cognitive Complexity of 284 (exceeds 5 allowed). Consider refactoring.
              Open

              },{"./src/decoder":2,"./src/demuxer":3,"./src/ogg":4}],2:[function(require,module,exports){
              /*
               * FLAC.js - Free Lossless Audio Codec decoder in JavaScript
               * Original C version from FFmpeg (c) 2003 Alex Beregszaszi
               * JavaScript port by Devon Govett and Jens Nockert of Official.fm Labs
              Severity: Minor
              Found in public/lib/modules/aurora.js/flac.js - About 5 days 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

              File Query.php has 2279 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              <?php
              
              declare(strict_types=0);
              
              /**
              Severity: Major
              Found in src/Repository/Model/Query.php - About 5 days to fix

                File Subsonic_Api.php has 2266 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                <?php
                
                declare(strict_types=0);
                
                /**
                Severity: Major
                Found in src/Module/Api/Subsonic_Api.php - About 5 days to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  declare(strict_types=0);
                  
                  /**
                  Severity: Major
                  Found in src/Module/Api/Method/GetIndexesMethod.php and 1 other location - About 5 days to fix
                  src/Module/Api/Method/Api5/GetIndexes5Method.php on lines 1..142

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 988.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  declare(strict_types=0);
                  
                  /**
                  Severity: Major
                  Found in src/Module/Api/Method/Api5/GetIndexes5Method.php and 1 other location - About 5 days to fix
                  src/Module/Api/Method/GetIndexesMethod.php on lines 1..144

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 988.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      public static function catalog_file(array $input, User $user): bool
                      {
                          if (!Api5::check_access('interface', 50, $user->id, self::ACTION, $input['api_format'])) {
                              return false;
                          }
                  Severity: Major
                  Found in src/Module/Api/Method/Api5/CatalogFile5Method.php and 1 other location - About 5 days to fix
                  src/Module/Api/Method/CatalogFileMethod.php on lines 60..165

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 927.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language