Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tween.js from tweenjs #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pavel-ignatovich
Copy link

@pavel-ignatovich pavel-ignatovich added Demonstration JS Files in JavaScript labels Jan 12, 2020
Copy link

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is autogenerated code-style review, new suggestions: 16

while (tweenIds.length > 0) {
this._tweensAddedDuringUpdate = {};

for (var i = 0; i < tweenIds.length; i++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = 0; i < tweenIds.length; i++) {
for (var i = 0; i < tweenIds.length; i += 1) {

This comment was generated with the following checker: FixMyJS

TWEEN.Group = _Group;
TWEEN._nextId = 0;
TWEEN.nextId = function () {
return TWEEN._nextId++;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return TWEEN._nextId++;
return TWEEN._nextId += 1;

This comment was generated with the following checker: FixMyJS


stopChainedTweens: function () {

for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i += 1) {

This comment was generated with the following checker: FixMyJS

if (this._repeat > 0) {

if (isFinite(this._repeat)) {
this._repeat--;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this._repeat--;
this._repeat -= 1;

This comment was generated with the following checker: FixMyJS

this._onCompleteCallback(this._object);
}

for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i += 1) {

This comment was generated with the following checker: FixMyJS

var pw = Math.pow;
var bn = TWEEN.Interpolation.Utils.Bernstein;

for (var i = 0; i <= n; i++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = 0; i <= n; i++) {
for (var i = 0; i <= n; i += 1) {

This comment was generated with the following checker: FixMyJS

return a[n];
}

for (var i = n; i > 1; i--) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = n; i > 1; i--) {
for (var i = n; i > 1; i -= 1) {

This comment was generated with the following checker: FixMyJS


},

update: function (time) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too long

update ( time ) now spans 80 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.

This comment was generated with the following checker: long_method


},

update: function (time) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too complicated

update ( time ) now has cyclomatic complexity of 26.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.

This comment was generated with the following checker: high_cyclomatic_complexity


},

interpolation: function (interpolationFunction) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name is too long

Parameter name interpolationFunction is now 21 characters long.
Keep length of your parameter names within 20 characters to improve readability.

This comment was generated with the following checker: naming_analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Demonstration JS Files in JavaScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant