sethbrasile/ember-audio

View on GitHub

Showing 6 of 13 total issues

Function load has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  load(src) {
    const audioContext = this.audioContext;
    const _load = this._load.bind(this);
    const _loadFont = this._loadFont.bind(this);
    const _loadBeatTrack = this._loadBeatTrack.bind(this);
Severity: Minor
Found in addon/services/audio.js - About 1 hr to fix

    Function onPlaySet has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      onPlaySet(key) {
        const startingValues = this.startingValues;
        const exponentialValues = this.exponentialRampToValuesAtTime;
        const linearValues = this.linearRampToValuesAtTime;
        const valuesAtTime = this.setValuesAtTime;
    Severity: Minor
    Found in addon/classes/connection.js - About 1 hr to fix

      Function _initConnections has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _initConnections: on('init', function () {
          const bufferSource = Connection.create({
            name: 'audioSource',
            createdOnPlay: true,
            source: 'audioContext',
      Severity: Minor
      Found in addon/mixins/connectable.js - About 1 hr to fix

        Function _initConnections has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _initConnections: on('init', function () {
            const bufferSource = this._createBufferSource();
            const gain = this._createGainNode();
            const panner = this._createPannerNode();
            const destination = this._createDestinationNode();
        Severity: Minor
        Found in addon/classes/oscillator.js - About 1 hr to fix

          Function seek has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            seek(amount) {
              const duration = this.get('duration.raw');
          
              const moveToOffset = (offset) => {
                const isPlaying = this.isPlaying;
          Severity: Minor
          Found in addon/classes/sound.js - About 45 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 _createNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            _createNode(connection) {
              const { path, name, createdOnPlay, source, createCommand, node } =
                connection;
          
              if (node && !createdOnPlay) {
          Severity: Minor
          Found in addon/mixins/connectable.js - 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