newraina/mePlayer

View on GitHub

Showing 57 of 57 total issues

Function mePlayer has 240 lines of code (exceeds 25 allowed). Consider refactoring.
Open

root.mePlayer = function(options) {
  // 检查必填选项
  if (!(options.music && options.music.src)) {
    console.error('必须指定音乐地址哦~')
    return
Severity: Major
Found in src/js/main.js - About 1 day to fix

    Function mePlayer has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

    root.mePlayer = function(options) {
      // 检查必填选项
      if (!(options.music && options.music.src)) {
        console.error('必须指定音乐地址哦~')
        return
    Severity: Minor
    Found in src/js/main.js - About 1 day 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 main.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { THEME_DEFAULT, THEME_MINI } from './constants'
    import * as lyric from './lyric'
    import * as utils from './utils'
    import * as spectrum from './spectrum'
    import * as selector from './selector'
    Severity: Minor
    Found in src/js/main.js - About 2 hrs to fix

      Function handlePlayClick has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function handlePlayClick() {
          var _handleMouseWheel
      
          if (audio.paused) {
            audio.play()
      Severity: Minor
      Found in src/js/main.js - About 1 hr to fix

        Function handleTimeUpdate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function handleTimeUpdate() {
            var curTime = audio.currentTime
            var curTimeForLrc = audio.currentTime.toFixed(3)
            var playPercent = 100 * (curTime / duration)
        
        
        Severity: Minor
        Found in src/js/main.js - About 1 hr to fix

          Function parse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          function parse(text) {
            var lyric = text.split('\n')
            var lrc = []
            var len = lyric.length
            var reg1 = /\[(\d{2}):(\d{2})\.(\d{2,3})]/g
          Severity: Minor
          Found in src/js/lyric.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

          Function parse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parse(text) {
            var lyric = text.split('\n')
            var lrc = []
            var len = lyric.length
            var reg1 = /\[(\d{2}):(\d{2})\.(\d{2,3})]/g
          Severity: Minor
          Found in src/js/lyric.js - About 1 hr to fix

            Function handleMouseWheel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    (function handleMouseWheel() {
                      var timer = null
                      var step = 0.05
                      _handleMouseWheel = function(event) {
                        if (timer) {
            Severity: Minor
            Found in src/js/main.js - About 1 hr to fix

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

              function currentIndex(time) {
                if (time < lyrics[0].time) return 0
                for (var i = 0, l = lyrics.length; i < l; i++) {
                  if (
                    time >= lyrics[i].time &&
              Severity: Minor
              Found in src/js/lyric.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

              Fallback color (hex or RGB) should precede RGBA color.
              Open

                  color: rgba(0, 0, 0, .6);
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-adjusting-volume .meplayer-volume-bg
              Open

              .meplayer-container.meplayer-adjusting-volume .meplayer-volume-bg {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-isplaying .meplayer-timeline
              Open

              .meplayer-container.meplayer-isplaying .meplayer-timeline {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Attribute selectors with ^= are slow!
              Open

               [class^="icon-"]:before, [class*=" icon-"]:before {
              Severity: Minor
              Found in src/fontello/fontello.css by csslint

              Adjoining classes: .meplayer-container.meplayer-isplaying .meplayer-meta
              Open

              .meplayer-container.meplayer-isplaying .meplayer-meta {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-isplaying .meplayer-meta .meplayer-meta-time-tick
              Open

              .meplayer-container.meplayer-isplaying .meplayer-meta .meplayer-meta-time-tick {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-haslrc .meplayer-spectrum
              Open

              .meplayer-container.meplayer-haslrc .meplayer-spectrum {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-isplaying .meplayer-spectrum
              Open

              .meplayer-container.meplayer-isplaying .meplayer-spectrum {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              The box-sizing property isn't supported in IE6 and IE7.
              Open

                  box-sizing: border-box;
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Adjoining classes: .meplayer-container.meplayer-isplaying .meplayer-control-play
              Open

              .meplayer-container.meplayer-isplaying .meplayer-control-play {
              Severity: Minor
              Found in src/css/theme-default.css by csslint

              Attribute selectors with ^= are slow!
              Open

              .meplayer-container-mini .meplayer-control-play [class^='icon-'] {
              Severity: Minor
              Found in src/css/theme-mini.css by csslint
              Severity
              Category
              Status
              Source
              Language