Code Duplication    Length = 33-33 lines in 2 locations

src/Oro/Bundle/WorkflowBundle/Resources/public/js/tools/path-finder/graph.js 2 locations

@@ 527-559 (lines=33) @@
524
    /**
525
     * Build nodes at endpoints on vertical axises
526
     */
527
    Graph.prototype.buildNodesAtEndPointsVertical = function() {
528
        var node;
529
        var newAxis;
530
        var i;
531
        var vAxis;
532
        var newHorizontalAxises = [];
533
        for (i = this.verticalAxises.length - 1; i >= 0; i--) {
534
            vAxis = this.verticalAxises[i];
535
            node = this.getNodeAt(vAxis.a);
536
            if (!node.stale) {
537
                newAxis = new BaseAxis(vAxis.a, vAxis.a, this, 0, new EmptyConstraint(), new EmptyConstraint(),
538
                    new CenterLocationDirective());
539
                newAxis.isVertical = false;
540
                newHorizontalAxises.push(newAxis);
541
                vAxis.addNode(node);
542
                newAxis.addNode(node);
543
                node.hAxis = newAxis;
544
                node.vAxis = vAxis;
545
            }
546
            node = this.getNodeAt(vAxis.b);
547
            if (!node.stale) {
548
                newAxis = new BaseAxis(vAxis.b, vAxis.b, this, 0, new EmptyConstraint(), new EmptyConstraint(),
549
                    new CenterLocationDirective());
550
                newAxis.isVertical = false;
551
                newHorizontalAxises.push(newAxis);
552
                vAxis.addNode(node);
553
                newAxis.addNode(node);
554
                node.hAxis = newAxis;
555
                node.vAxis = vAxis;
556
            }
557
        }
558
        return newHorizontalAxises;
559
    };
560
561
    /**
562
     * Prepares merge axises requests
@@ 490-522 (lines=33) @@
487
    /**
488
     * Build nodes at endpoints on horizontal axises
489
     */
490
    Graph.prototype.buildNodesAtEndPointsHorizontal = function() {
491
        var node;
492
        var newAxis;
493
        var i;
494
        var hAxis;
495
        var newVerticalAxises = [];
496
        for (i = this.horizontalAxises.length - 1; i >= 0; i--) {
497
            hAxis = this.horizontalAxises[i];
498
            node = this.getNodeAt(hAxis.a);
499
            if (!node.stale) {
500
                newAxis = new BaseAxis(hAxis.a, hAxis.a, this, 0, new EmptyConstraint(), new EmptyConstraint(),
501
                    new CenterLocationDirective());
502
                newAxis.isVertical = true;
503
                newVerticalAxises.push(newAxis);
504
                hAxis.addNode(node);
505
                newAxis.addNode(node);
506
                node.hAxis = hAxis;
507
                node.vAxis = newAxis;
508
            }
509
            node = this.getNodeAt(hAxis.b);
510
            if (!node.stale) {
511
                newAxis = new BaseAxis(hAxis.b, hAxis.b, this, 0, new EmptyConstraint(), new EmptyConstraint(),
512
                    new CenterLocationDirective());
513
                newAxis.isVertical = true;
514
                newVerticalAxises.push(newAxis);
515
                hAxis.addNode(node);
516
                newAxis.addNode(node);
517
                node.hAxis = hAxis;
518
                node.vAxis = newAxis;
519
            }
520
        }
521
        return newVerticalAxises;
522
    };
523
524
    /**
525
     * Build nodes at endpoints on vertical axises