<commit_before>/*global CanvasShapes*/

CanvasShapes.BezierCurve = (function () {

    var MIN_COORDINATES = 3,
        // in theory this should allow you to draw any N-grade Bezier Curves
        MAX_COORDINATES = undefined;

    /**
     * Class representing a Bezier Curve of n-th degree. Degree depeneds on the
     * number of coordinates passed as an argument. Array of 3 coordinates means
     * that a curve of 1st degree will be created (quadratic). Array of 5
     * coordinates will create a bezier curve of 3rd degree.
     *
     * @see https://en.wikipedia.org/wiki/B%C3%A9zier_curve
     *
     * @param {[array,]} coordinates
     */
    var BezierCurve = function (coordinates) {
        this.setUUID();
        this.MIN_COORDINATES = MIN_COORDINATES;
        this.MAX_COORDINATES = MAX_COORDINATES;

        // checking if passed coordinates are in a correct format
        this.validateCoordinatesArray(
            coordinates,
            true,
            this.MIN_COORDINATES,
            this.MAX_COORDINATES
        );

        this.setCoordinates(coordinates);
    };

    CanvasShapes.Class.extend(
        BezierCurve.prototype,
        CanvasShapes.Shape.prototype,
    {

        _className: 'CanvasShapes.BezierCurve',

        /**
         * Gets the grade of this instance of a Bezier curve.
         *
         * @return {integer}
         */
        getGrade: function () {
            if (!this._grade) {
                this._grade = this.getCoordinates().length - 2;
            }
            return this._grade;
        },

        /**
         * @implements {CanvasShapes.RenderingInterface}
         */
        render: function (layer) {

            var i, points, coordinates,
                style = this.getStyle(),
                context = layer.getContext();

            points = this._getRenderingPoints(layer);

            context.beginPath();

            context.moveTo(
                points[0][0],
                points[0][1]
            );<commit_msg>BezierCurve polish<commit_after>/*global CanvasShapes*/

CanvasShapes.BezierCurve = (function () {

    var MIN_COORDINATES = 3,
        // in theory this should allow you to draw any N-grade Bezier Curves
        MAX_COORDINATES = undefined;

    /**
     * Class representing a Bezier Curve of n-th degree. Degree depeneds on the
     * number of coordinates passed as an argument. Array of 3 coordinates means
     * that a curve of 1st degree will be created (quadratic). Array of 5
     * coordinates will create a bezier curve of 3rd degree.
     *
     * @see https://en.wikipedia.org/wiki/B%C3%A9zier_curve
     *
     * @param {[array]} coordinates
     */
    var BezierCurve = function (coordinates) {
        this.setUUID();
        this.MIN_COORDINATES = MIN_COORDINATES;
        this.MAX_COORDINATES = MAX_COORDINATES;

        // checking if passed coordinates are in a correct format
        this.validateCoordinatesArray(
            coordinates,
            true,
            this.MIN_COORDINATES,
            this.MAX_COORDINATES
        );

        this.setCoordinates(coordinates);
    };

    CanvasShapes.Class.extend(
        BezierCurve.prototype,
        CanvasShapes.Shape.prototype,
    {
        _className: 'CanvasShapes.BezierCurve',

        /**
         * Gets the grade of this instance of a Bezier curve.
         *
         * @return {integer}
         */
        getGrade: function () {
            if (!this._grade) {
                this._grade = this.getCoordinates().length - 2;
            }
            return this._grade;
        },

        /**
         * @implements {CanvasShapes.RenderingInterface}
         */
        render: function (layer) {

            var i, points, coordinates,
                style = this.getStyle(),
                context = layer.getContext();

            points = this._getRenderingPoints(layer);

            context.beginPath();

            context.moveTo(
                points[0][0],
                points[0][1]
            );
{'fraction_non_alphanumeric': 0.09122545364156102, 'fraction_numerical': 0.005965697240865026, 'mean_word_length': 1.7505126452494875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2216144', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1099, 'n_words': 283}