meandmax/lory

View on GitHub

Showing 9 of 9 total issues

Function lory has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring.
Open

export function lory (slider, opts) {
    let position;
    let slidesWidth;
    let frameWidth;
    let slides;
Severity: Minor
Found in src/lory.js - About 2 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 lory has 353 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function lory (slider, opts) {
    let position;
    let slidesWidth;
    let frameWidth;
    let slides;
Severity: Major
Found in src/lory.js - About 1 day to fix

    File lory.js has 360 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* globals jQuery */
    
    import detectPrefixes from './utils/detect-prefixes.js';
    import supportsPassive from './utils/detect-supportsPassive';
    import dispatchEvent from './utils/dispatch-event.js';
    Severity: Minor
    Found in src/lory.js - About 4 hrs to fix

      Function exports has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (config) {
          var customLaunchers = {
              sauceLabsInternetExplorer10: {
                  base: 'SauceLabs',
                  browserName: 'internet explorer',
      Severity: Major
      Found in saucelabs.karma.conf.js - About 3 hrs to fix

        Function slide has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function slide (nextIndex, direction) {
                const {
                    slideSpeed,
                    slidesToScroll,
                    infinite,
        Severity: Major
        Found in src/lory.js - About 3 hrs to fix

          Function setup has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function setup () {
                  dispatchSliderEvent('before', 'init');
          
                  prefixes = detectPrefixes();
                  options = {...defaults, ...opts};
          Severity: Minor
          Found in src/lory.js - About 1 hr to fix

            Function exports has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (config) {
                config.set({
                    frameworks: [
                        'mocha',
                        'chai',
            Severity: Minor
            Found in local.karma.conf.js - About 1 hr to fix

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

              module.exports = function (config) {
                  config.set({
                      frameworks: [
                          'mocha',
                          'chai',
              Severity: Minor
              Found in travis.karma.conf.js - About 1 hr to fix

                Function detectPrefixes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function detectPrefixes () {
                    let transform;
                    let transition;
                    let transitionEnd;
                
                
                Severity: Minor
                Found in src/utils/detect-prefixes.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language