nemesiscodex/openfonacide

View on GitHub
static/js/dncp/util/ecAnimation.js

Summary

Maintainability
F
5 days
Test Coverage

File ecAnimation.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * echarts图表动画基类
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
Severity: Minor
Found in static/js/dncp/util/ecAnimation.js - About 6 hrs to fix

    Function rectangle has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function rectangle(zr, oldShape, newShape, duration, easing) {
            var newShapeStyle = newShape.style;
            if (!oldShape) {        // add
                oldShape = {
                    position : newShape.position,
    Severity: Major
    Found in static/js/dncp/util/ecAnimation.js - About 2 hrs to fix

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

          function pointList(zr, oldShape, newShape, duration, easing) {
              var newPointList = newShape.style.pointList;
              var newPointListLen = newPointList.length;
              var oldPointList;
      
      
      Severity: Minor
      Found in static/js/dncp/util/ecAnimation.js - About 2 hrs to fix

        Function markline has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function markline(zr, oldShape, newShape, duration, easing) {
                easing = easing || 'QuinticOut';
                newShape.__animating = true;
                zr.addShape(newShape);
                var newShapeStyle = newShape.style;
        Severity: Minor
        Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

          Function ring has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function ring(zr, oldShape, newShape, duration, easing) {
                  var x = newShape.style.x;
                  var y = newShape.style.y;
                  var r0 = newShape.style.r0;
                  var r = newShape.style.r;
          Severity: Minor
          Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

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

                function ribbon(zr, oldShape, newShape, duration, easing) {
                    if (!oldShape) {        // add
                        oldShape = {
                            style : {
                                source0 : 0,
            Severity: Minor
            Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

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

                  function line(zr, oldShape, newShape, duration, easing) {
                      if (!oldShape) {
                          oldShape = {
                              style : {
                                  xStart : newShape.style.xStart,
              Severity: Minor
              Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

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

                    function sector(zr, oldShape, newShape, duration, easing) {
                        if (!oldShape) {        // add
                            if (newShape._animationAdd != 'r') {
                                oldShape = {
                                    style : {
                Severity: Minor
                Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

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

                      function text(zr, oldShape, newShape, duration, easing) {
                          if (!oldShape) {        // add
                              oldShape = {
                                  style : {
                                      x : newShape.style.textAlign == 'left' 
                  Severity: Minor
                  Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

                    Function icon has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function icon(zr, oldShape, newShape, duration, easing, delay) {
                    Severity: Minor
                    Found in static/js/dncp/util/ecAnimation.js - About 45 mins to fix

                      Function rectangle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function rectangle(zr, oldShape, newShape, duration, easing) {
                      Severity: Minor
                      Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                        Function ribbon has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function ribbon(zr, oldShape, newShape, duration, easing) {
                        Severity: Minor
                        Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                          Function markline has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              function markline(zr, oldShape, newShape, duration, easing) {
                          Severity: Minor
                          Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                            Function polygon has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function polygon(zr, oldShape, newShape, duration, easing) {
                            Severity: Minor
                            Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                              Function candle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  function candle(zr, oldShape, newShape, duration, easing) {
                              Severity: Minor
                              Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                Function line has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    function line(zr, oldShape, newShape, duration, easing) {
                                Severity: Minor
                                Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                  Function gaugePointer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      function gaugePointer(zr, oldShape, newShape, duration, easing) {
                                  Severity: Minor
                                  Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                    Function pointList has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        function pointList(zr, oldShape, newShape, duration, easing) {
                                    Severity: Minor
                                    Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                      Function sector has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          function sector(zr, oldShape, newShape, duration, easing) {
                                      Severity: Minor
                                      Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                        Function text has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            function text(zr, oldShape, newShape, duration, easing) {
                                        Severity: Minor
                                        Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

                                          Function ring has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              function ring(zr, oldShape, newShape, duration, easing) {
                                          Severity: Minor
                                          Found in static/js/dncp/util/ecAnimation.js - About 35 mins to fix

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                x: newX,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 2 hrs to fix
                                            static/js/dncp/util/ecAnimation.js on lines 412..425
                                            static/js/dncp/util/ecAnimation.js on lines 534..547

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                xStart: xStart,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 2 hrs to fix
                                            static/js/dncp/util/ecAnimation.js on lines 148..161
                                            static/js/dncp/util/ecAnimation.js on lines 412..425

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                source0 : source0,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 2 hrs to fix
                                            static/js/dncp/util/ecAnimation.js on lines 148..161
                                            static/js/dncp/util/ecAnimation.js on lines 534..547

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                startAngle : startAngle,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 217..228
                                            static/js/dncp/util/ecAnimation.js on lines 333..344

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                x : x,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 217..228
                                            static/js/dncp/util/ecAnimation.js on lines 288..299

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

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

                                                        zr.animate(newShape.id, 'style')
                                                            .when(
                                                                duration,
                                                                {
                                                                    r0 : r0,
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 288..299
                                            static/js/dncp/util/ecAnimation.js on lines 333..344

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            { y: newY }
                                                        )
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 240..250
                                            static/js/dncp/util/ecAnimation.js on lines 450..460

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

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

                                                    zr.animate(newShape.id, 'style')
                                                        .when(
                                                            duration,
                                                            {
                                                                angle : angle
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 183..191
                                            static/js/dncp/util/ecAnimation.js on lines 240..250

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

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

                                                        zr.animate(newShape.id, 'style')
                                                            .when(
                                                                duration,
                                                                {
                                                                    r0 : r0
                                            Severity: Major
                                            Found in static/js/dncp/util/ecAnimation.js and 2 other locations - About 1 hr to fix
                                            static/js/dncp/util/ecAnimation.js on lines 183..191
                                            static/js/dncp/util/ecAnimation.js on lines 450..460

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

                                            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