monsij/StudentPortal

View on GitHub
pro1/staticfiles/blog/bootstrap/js/modules/waves.js

Summary

Maintainability
F
3 wks
Test Coverage

File waves.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Waves v0.7.6
 * http://fian.my.id/Waves
 *
 * Copyright 2014-2018 Alfiana E. Sibuea and other contributors
Severity: Minor
Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js - About 5 hrs to fix

    Function showEffect has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function showEffect(e) {
    
            // Disable effect if element has "disabled" property on it
            // In some cases, the event is not triggered by the current element
            // if (e.target.getAttribute('disabled') !== null) {
    Severity: Minor
    Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js - About 2 hrs to fix

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

              show: function(e, element, velocity) {
      
                  // Disable right click
                  if (e.button === 2) {
                      return false;
      Severity: Minor
      Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js - About 1 hr to fix

        Function removeRipple has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function removeRipple(e, el, ripple) {
        
                // Check if the ripple still exist
                if (!ripple) {
                    return;
        Severity: Minor
        Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js - About 1 hr to fix

          Function ripple has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Waves.ripple = function(elements, options) {
                  elements = getWavesElements(elements);
                  var elementsLen = elements.length;
          
                  options          = options || {};
          Severity: Minor
          Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js - About 1 hr to fix

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

            ;(function(window, factory) {
                'use strict';
            
                // AMD. Register as an anonymous module.  Wrap in function so we have access
                // to root via `this`.
            Severity: Major
            Found in pro1/staticfiles/blog/bootstrap/js/modules/waves.js and 3 other locations - About 3 wks to fix
            pro1/staticfiles/blog/bootstrap/js/mdb.js on lines 14843..15433
            pro1/staticfiles/bootstrap/js/mdb.js on lines 14843..15433
            pro1/staticfiles/bootstrap/js/modules/waves.js on lines 10..600

            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 4056.

            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

            There are no issues that match your filters.

            Category
            Status