shadowproject/shadow

View on GitHub

Showing 126 of 126 total issues

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

            momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };
Severity: Major
Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 2 hrs to fix
src/qt/res/assets/plugins/iscroll/iscroll.js on lines 634..634

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

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

            momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };
Severity: Major
Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 2 hrs to fix
src/qt/res/assets/plugins/iscroll/iscroll.js on lines 635..635

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

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

function Indicator (scroller, options) {
    this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
    this.wrapperStyle = this.wrapper.style;
    this.indicator = this.wrapper.children[0];
    this.indicatorStyle = this.indicator.style;
Severity: Major
Found in src/qt/res/assets/plugins/iscroll/iscroll.js - About 2 hrs to fix

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

                case this.options.keyBindings.pageDown:
                    if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
                        newX -= snap ? 1 : this.wrapperWidth;
                    } else {
                        newY -= snap ? 1 : this.wrapperHeight;
    Severity: Major
    Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 2 hrs to fix
    src/qt/res/assets/plugins/iscroll/iscroll.js on lines 1509..1515

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

    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

                    } else if (i < 15) {
                        this.rectangle(0 * cell + margin, (i - 10) * cell + margin, cell, cell, color, image);
                        this.rectangle(4 * cell + margin, (i - 10) * cell + margin, cell, cell, color, image);
                    }
    Severity: Major
    Found in src/qt/res/assets/plugins/identicon/identicon.js and 1 other location - About 2 hrs to fix
    src/qt/res/assets/plugins/identicon/identicon.js on lines 69..75

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

    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

                case this.options.keyBindings.pageUp:
                    if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
                        newX += snap ? 1 : this.wrapperWidth;
                    } else {
                        newY += snap ? 1 : this.wrapperHeight;
    Severity: Major
    Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 2 hrs to fix
    src/qt/res/assets/plugins/iscroll/iscroll.js on lines 1516..1522

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

    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

                    } else if (i < 10) {
                        this.rectangle(1 * cell + margin, (i - 5) * cell + margin, cell, cell, color, image);
                        this.rectangle(3 * cell + margin, (i - 5) * cell + margin, cell, cell, color, image);
                    } else if (i < 15) {
                        this.rectangle(0 * cell + margin, (i - 10) * cell + margin, cell, cell, color, image);
    Severity: Major
    Found in src/qt/res/assets/plugins/identicon/identicon.js and 1 other location - About 2 hrs to fix
    src/qt/res/assets/plugins/identicon/identicon.js on lines 72..75

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

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

            p.init = function (ft) {
                p.footable = ft;
                if (ft.options.filter.enabled === true) {
                    if ($(ft.table).data('filter') === false) return;
                    ft.timers.register('filter');
    Severity: Major
    Found in src/qt/res/assets/plugins/footable/footable.filter.js - About 2 hrs to fix

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

                  } else if ( y > this.maxBoundaryY ) {
                      if ( this.options.shrink == 'scale' ) {
                          this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);
                          this.indicatorStyle.height = this.height + 'px';
                          y = this.maxPosY + this.indicatorHeight - this.height;
      Severity: Major
      Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 1 hr to fix
      src/qt/res/assets/plugins/iscroll/iscroll.js on lines 2026..2037

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

      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

                  } else if ( x > this.maxBoundaryX ) {
                      if ( this.options.shrink == 'scale' ) {
                          this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);
                          this.indicatorStyle.width = this.width + 'px';
                          x = this.maxPosX + this.indicatorWidth - this.width;
      Severity: Major
      Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 1 hr to fix
      src/qt/res/assets/plugins/iscroll/iscroll.js on lines 2045..2056

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

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

          updatePosition: function () {
              var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,
                  y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;
      
              if ( !this.options.ignoreBoundaries ) {
      Severity: Minor
      Found in src/qt/res/assets/plugins/iscroll/iscroll.js - About 1 hr to fix

        Function iconGenerator has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function iconGenerator(renderer, hash, x, y, size, padding, config) {
                var undefined;
                
                // Calculate padding
                padding = (size * (padding === undefined ? 0.08 : padding)) | 0;
        Severity: Minor
        Found in src/qt/res/assets/plugins/jdenticon/jdenticon-1.3.2.js - About 1 hr to fix

          Function handleEvent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              handleEvent: function (e) {
                  switch ( e.type ) {
                      case 'touchstart':
                      case 'pointerdown':
                      case 'MSPointerDown':
          Severity: Minor
          Found in src/qt/res/assets/plugins/iscroll/iscroll.js - About 1 hr to fix

            Function parse_po has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            def parse_po(text):
                """
                Parse 'po' format produced by xgettext.
                Return a list of (msgid,msgstr) tuples.
                """
            Severity: Minor
            Found in share/qt/extract_strings_qt.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

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

                    if ( this.directionLocked == 'h' ) {
                        if ( this.options.eventPassthrough == 'vertical' ) {
                            e.preventDefault();
                        } else if ( this.options.eventPassthrough == 'horizontal' ) {
                            this.initiated = false;
            Severity: Major
            Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 1 hr to fix
            src/qt/res/assets/plugins/iscroll/iscroll.js on lines 534..543

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

            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

                    } else if ( this.directionLocked == 'v' ) {
                        if ( this.options.eventPassthrough == 'horizontal' ) {
                            e.preventDefault();
                        } else if ( this.options.eventPassthrough == 'vertical' ) {
                            this.initiated = false;
            Severity: Major
            Found in src/qt/res/assets/plugins/iscroll/iscroll.js and 1 other location - About 1 hr to fix
            src/qt/res/assets/plugins/iscroll/iscroll.js on lines 525..543

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

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

                    ft.getColumnData = function (th) {
                        var $th = $(th), hide = $th.data('hide'), index = $th.index();
                        hide = hide || '';
                        hide = jQuery.map(hide.split(','), function (a) {
                            return jQuery.trim(a);
            Severity: Minor
            Found in src/qt/res/assets/plugins/footable/footable.js - About 1 hr to fix

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

              elif cmd == "listreceivedbyaccount":
                  try:
                      mc = raw_input("Minimum confirmations (optional): ")
                      incemp = raw_input("Include empty? (true/false, optional): ")
                      try:
              Severity: Major
              Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
              contrib/bitrpc/bitrpc.py on lines 46..55
              contrib/bitrpc/bitrpc.py on lines 116..125
              contrib/bitrpc/bitrpc.py on lines 127..136
              contrib/bitrpc/bitrpc.py on lines 186..195

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

              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 5 locations. Consider refactoring.
              Open

              elif cmd == "listreceivedbyaddress":
                  try:
                      mc = raw_input("Minimum confirmations (optional): ")
                      incemp = raw_input("Include empty? (true/false, optional): ")
                      try:
              Severity: Major
              Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
              contrib/bitrpc/bitrpc.py on lines 46..55
              contrib/bitrpc/bitrpc.py on lines 116..125
              contrib/bitrpc/bitrpc.py on lines 127..136
              contrib/bitrpc/bitrpc.py on lines 175..184

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

              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 5 locations. Consider refactoring.
              Open

              elif cmd == "getbalance":
                  try:
                      acct = raw_input("Enter an account (optional): ")
                      mc = raw_input("Minimum confirmations (optional): ")
                      try:
              Severity: Major
              Found in contrib/bitrpc/bitrpc.py and 4 other locations - About 1 hr to fix
              contrib/bitrpc/bitrpc.py on lines 116..125
              contrib/bitrpc/bitrpc.py on lines 127..136
              contrib/bitrpc/bitrpc.py on lines 175..184
              contrib/bitrpc/bitrpc.py on lines 186..195

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

              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

              Severity
              Category
              Status
              Source
              Language