Reactive-Extensions/RxJS

View on GitHub
examples/canvaspaint/excanvas_src.js

Summary

Maintainability
F
6 days
Test Coverage

Showing 23 of 23 total issues

File excanvas_src.js has 672 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Severity: Major
Found in examples/canvaspaint/excanvas_src.js - About 1 day to fix

    Function stroke has 143 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    contextPrototype.stroke = function(aFill) {
    var lineStr = [];
    var lineOpen = false;
    var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);
    var color = a.color;
    Severity: Major
    Found in examples/canvaspaint/excanvas_src.js - About 5 hrs to fix

      Function drawImage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      contextPrototype.drawImage = function(image, var_args) {
      var dx, dy, dw, dh, sx, sy, sw, sh;
       
      // to find the original width we overide the width and height
      var oldRuntimeWidth = image.runtimeStyle.width;
      Severity: Major
      Found in examples/canvaspaint/excanvas_src.js - About 3 hrs to fix

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

        init_: function(doc) {
        // create xmlns
        if (!doc.namespaces['g_vml_']) {
        doc.namespaces.add('g_vml_', 'urn:schemas-microsoft-com:vml',
        '#default#VML');
        Severity: Minor
        Found in examples/canvaspaint/excanvas_src.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

          if (angle < 1e-6) {
          angle = 0;
          }
          Severity: Major
          Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

            contextPrototype.arc = function(aX, aY, aRadius,
            aStartAngle, aEndAngle, aClockwise) {
            Severity: Minor
            Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

              contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
              aX1, aY1, aR1) {
              Severity: Minor
              Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

                contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
                Severity: Minor
                Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                  if (angle < 0) {
                  angle += 360;
                  }
                  Severity: Major
                  Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

                    contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
                    Severity: Minor
                    Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

                      contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
                      aCP2x, aCP2y,
                      aX, aY) {
                      Severity: Minor
                      Found in examples/canvaspaint/excanvas_src.js - About 45 mins to fix

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

                        contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
                        var oldPath = this.currentPath_;
                        this.beginPath();
                         
                        this.moveTo(aX, aY);
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 5 hrs to fix
                        examples/canvaspaint/excanvas_src.js on lines 444..456

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

                        contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
                        var oldPath = this.currentPath_;
                        this.beginPath();
                         
                        this.moveTo(aX, aY);
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 5 hrs to fix
                        examples/canvaspaint/excanvas_src.js on lines 458..470

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

                        contextPrototype.moveTo = function(aX, aY) {
                        var p = this.getCoords_(aX, aY);
                        this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y});
                        this.currentX_ = p.x;
                        this.currentY_ = p.y;
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 3 hrs to fix
                        examples/canvaspaint/excanvas_src.js on lines 353..359

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

                        contextPrototype.lineTo = function(aX, aY) {
                        var p = this.getCoords_(aX, aY);
                        this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y});
                         
                        this.currentX_ = p.x;
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 3 hrs to fix
                        examples/canvaspaint/excanvas_src.js on lines 346..351

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

                        case 'height':
                        el.style.height = el.attributes.height.nodeValue + 'px';
                        el.getContext().clearRect();
                        break;
                        Severity: Minor
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 55 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 191..194

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

                        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
                        Severity: Minor
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 55 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 797..797

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

                        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
                        Severity: Minor
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 55 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 798..798

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

                        case 'width':
                        el.style.width = el.attributes.width.nodeValue + 'px';
                        el.getContext().clearRect();
                        break;
                        Severity: Minor
                        Found in examples/canvaspaint/excanvas_src.js and 1 other location - About 55 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 195..198

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

                        if (min.y == null || p.y < min.y) {
                        min.y = p.y;
                        }
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 3 other locations - About 35 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 662..664
                        examples/canvaspaint/excanvas_src.js on lines 665..667
                        examples/canvaspaint/excanvas_src.js on lines 671..673

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

                        if (max.y == null || p.y > max.y) {
                        max.y = p.y;
                        }
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 3 other locations - About 35 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 662..664
                        examples/canvaspaint/excanvas_src.js on lines 665..667
                        examples/canvaspaint/excanvas_src.js on lines 668..670

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

                        if (max.x == null || p.x > max.x) {
                        max.x = p.x;
                        }
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 3 other locations - About 35 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 662..664
                        examples/canvaspaint/excanvas_src.js on lines 668..670
                        examples/canvaspaint/excanvas_src.js on lines 671..673

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

                        if (min.x == null || p.x < min.x) {
                        min.x = p.x;
                        }
                        Severity: Major
                        Found in examples/canvaspaint/excanvas_src.js and 3 other locations - About 35 mins to fix
                        examples/canvaspaint/excanvas_src.js on lines 665..667
                        examples/canvaspaint/excanvas_src.js on lines 668..670
                        examples/canvaspaint/excanvas_src.js on lines 671..673
                        Category
                        Status