YuntechNet/AtomicP2P

View on GitHub

Showing 209 of 209 total issues

Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                                mightThrow = function() {
                                    var returned, then;

                                    // Support: Promises/A+ section 2.3.3.3.3
                                    // https://promisesaplus.com/#point-59
Severity: Minor
Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

        handlers: function( event, handlers ) {
            var i, handleObj, sel, matchedHandlers, matchedSelectors,
                handlerQueue = [],
                delegateCount = handlers.delegateCount,
                cur = event.target;
    Severity: Minor
    Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

          setOffset: function( elem, options, i ) {
              var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
                  position = jQuery.css( elem, "position" ),
                  curElem = jQuery( elem ),
                  props = {};
      Severity: Minor
      Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
        
                // Trust units reported by jQuery.css
                unit = unit || initialInUnit[ 3 ];
        
        
        Severity: Critical
        Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

          function showHide( elements, show ) {
              var display, elem,
                  values = [],
                  index = 0,
                  length = elements.length;
          Severity: Minor
          Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                    if ( jQuery.isFunction( value ) ) {
                        return this.each( function( j ) {
                            jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
                        } );
                    }
            Severity: Major
            Found in docs/_static/jquery-3.2.1.js and 1 other location - About 1 hr to fix
            docs/_static/jquery-3.2.1.js on lines 7768..7772

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

            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

                    if ( jQuery.isFunction( value ) ) {
                        return this.each( function( j ) {
                            jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
                        } );
                    }
            Severity: Major
            Found in docs/_static/jquery-3.2.1.js and 1 other location - About 1 hr to fix
            docs/_static/jquery-3.2.1.js on lines 7805..7809

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

            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 join_net_by_DNS has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def join_net_by_DNS(self, domain: str, ns: List[str] = None, **kwargs) -> None:
                    """Join into a net with known domain.
                    This method is use to join a net with known domain while current peer 
                      is not in any net yet.
                    The domain can point to single or multiple exists host in net.
            Severity: Minor
            Found in atomic_p2p/mixin/topology/lan/__init__.py - 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 __on_send has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def __on_send(self, sock: "Socket", mask, **kwargs):
                    """Method use when sending data to socket."""
                    q = self.__packet_queue[sock] if sock in self.__packet_queue else None
                    while q is not None and q.empty() is False:
                        try:
            Severity: Minor
            Found in atomic_p2p/peer/peer.py - 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 load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jQuery.fn.load = function( url, params, callback ) {
                var selector, type, response,
                    self = this,
                    off = url.indexOf( " " );
            
            
            Severity: Minor
            Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

              Function removeClass has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  removeClass: function( value ) {
                      var classes, elem, cur, curValue, clazz, j, finalValue,
                          i = 0;
              
                      if ( jQuery.isFunction( value ) ) {
              Severity: Minor
              Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                Function speed has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jQuery.speed = function( speed, easing, fn ) {
                    var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
                        complete: fn || !fn && easing ||
                            jQuery.isFunction( speed ) && speed,
                        duration: speed,
                Severity: Minor
                Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                      preventDefault: function() {
                          var e = this.originalEvent;
                  
                          this.isDefaultPrevented = returnTrue;
                  
                  
                  Severity: Major
                  Found in docs/_static/jquery-3.2.1.js and 1 other location - About 1 hr to fix
                  docs/_static/jquery-3.2.1.js on lines 5448..5456

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

                  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

                      stopPropagation: function() {
                          var e = this.originalEvent;
                  
                          this.isPropagationStopped = returnTrue;
                  
                  
                  Severity: Major
                  Found in docs/_static/jquery-3.2.1.js and 1 other location - About 1 hr to fix
                  docs/_static/jquery-3.2.1.js on lines 5439..5447

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

                  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 attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      attr: function( elem, name, value ) {
                          var ret, hooks,
                              nType = elem.nodeType;
                  
                          // Don't get/set attributes on text, comment and attribute nodes
                  Severity: Minor
                  Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

                    Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Major
                    Found in atomic_p2p/peer/process_peer.py - About 1 hr to fix

                      Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(
                      Severity: Major
                      Found in atomic_p2p/peer/thread_peer.py - About 1 hr to fix

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

                            finish: function( type ) {
                                if ( type !== false ) {
                                    type = type || "fx";
                                }
                                return this.each( function() {
                        Severity: Minor
                        Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                          jQuery.parseHTML = function( data, context, keepScripts ) {
                              if ( typeof data !== "string" ) {
                                  return [];
                              }
                              if ( typeof context === "boolean" ) {
                          Severity: Minor
                          Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix

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

                                off: function( types, selector, fn ) {
                                    var handleObj, type;
                                    if ( types && types.preventDefault && types.handleObj ) {
                            
                                        // ( event )  dispatched jQuery.Event
                            Severity: Minor
                            Found in docs/_static/jquery-3.2.1.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language