crcastle/collaborative-code-conference

View on GitHub

Showing 101 of 101 total issues

Function loadGistModal has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Gister.prototype.loadGistModal = function() {
  var frame = document.querySelector('#gistModal');
  var modalBody   = '<p>What is the gist URL? All text in the editor will be '
                    +'replaced with the gist content.</p>'
                    +'<input style="width: 100%;" id="gist-url" type="text">';
Severity: Major
Found in src/client/gister.js - About 2 hrs to fix

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

  anchor.addEventListener('click', function(e) {
    e.preventDefault();
    cm.setOption('mode', mime);
    document.querySelector('#language-button-text').innerHTML = 'Language: ' + name;
    cm.focus();
Severity: Major
Found in src/client/coding.js and 1 other location - About 1 hr to fix
src/client/coding.js on lines 104..109

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

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

  anchor.addEventListener('click', function(e) {
    e.preventDefault();
    cm.setOption('theme', classPrefix);
    document.querySelector('#theme-button-text').innerHTML = 'Theme: ' + name;
    cm.focus();
Severity: Major
Found in src/client/coding.js and 1 other location - About 1 hr to fix
src/client/coding.js on lines 63..68

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

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

Function clientConnected has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function clientConnected() {
  // document.getElementById('invite-controls').style.display = 'block';
  console.log("Connected to Twilio. Listening for incoming Invites as '", conversationsClient.identity, "'");

  conversationsClient.on('invite', function (invite) {
Severity: Minor
Found in src/client/webrtc.js - About 1 hr to fix

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

for (var j = 0; j < themes.length; j++) {
  themeSelector.appendChild(themeListItem(themes[j].name, themes[j].classPrefix));
}
Severity: Major
Found in src/client/coding.js and 1 other location - About 1 hr to fix
src/client/coding.js on lines 90..92

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

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

for (var i = 0; i < languages.length; i++) {
  modeSelector.appendChild(languageListItem(languages[i].name, languages[i].mime));
}
Severity: Major
Found in src/client/coding.js and 1 other location - About 1 hr to fix
src/client/coding.js on lines 125..127

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

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

Rule doesn't have all its properties in alphabetical order.
Open

.CodeMirror-gutters {
Severity: Minor
Found in src/client/codemirror.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.CodeMirror-measure {
Severity: Minor
Found in src/client/codemirror.css by csslint

Element (div.CodeMirror-dragcursors) is overqualified, just use .CodeMirror-dragcursors without element name.
Open

div.CodeMirror-dragcursors {
Severity: Minor
Found in src/client/codemirror.css by csslint

Don't use IDs in selectors.
Open

#local-media {
Severity: Minor
Found in src/client/index.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.CodeMirror-scroll {
Severity: Minor
Found in src/client/codemirror.css by csslint

Don't use IDs in selectors.
Open

#code-options {
Severity: Minor
Found in src/client/index.css by csslint

Don't use IDs in selectors.
Open

#local-media, #local-media video {
Severity: Minor
Found in src/client/index.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

#remote-media-wrapper {
Severity: Minor
Found in src/client/index.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

#editor-connection-status {
Severity: Minor
Found in src/client/index.css by csslint

Do not use 'new' for side effects.
Open

          new bsn.Button(e.target, 'reset');
Severity: Minor
Found in src/client/gister.js by eslint

Disallow new For Side Effects (no-new)

The goal of using new with a constructor is typically to create an object of a particular type and store that object in a variable, such as:

var person = new Person();

It's less common to use new and not store the result, such as:

new Person();

In this case, the created object is thrown away because its reference isn't stored anywhere, and in many cases, this means that the constructor should be replaced with a function that doesn't require new to be used.

Rule Details

This rule is aimed at maintaining consistency and convention by disallowing constructor calls using the new keyword that do not assign the resulting object to a variable.

Examples of incorrect code for this rule:

/*eslint no-new: "error"*/

new Thing();

Examples of correct code for this rule:

/*eslint no-new: "error"*/

var thing = new Thing();

Thing();

Source: http://eslint.org/docs/rules/

Unexpected alert.
Open

          alert('Only two participants supported at this time.');
Severity: Minor
Found in src/client/webrtc.js by eslint

Disallow Use of Alert (no-alert)

JavaScript's alert, confirm, and prompt functions are widely considered to be obtrusive as UI elements and should be replaced by a more appropriate custom UI implementation. Furthermore, alert is often used while debugging code, which should be removed before deployment to production.

alert("here!");

Rule Details

This rule is aimed at catching debugging code that should be removed and popup UI elements that should be replaced with less obtrusive, custom UIs. As such, it will warn when it encounters alert, prompt, and confirm function calls which are not shadowed.

Examples of incorrect code for this rule:

/*eslint no-alert: "error"*/

alert("here!");

confirm("Are you sure?");

prompt("What's your name?", "John Doe");

Examples of correct code for this rule:

/*eslint no-alert: "error"*/

customAlert("Something happened!");

customConfirm("Are you sure?");

customPrompt("Who are you?");

function foo() {
    var alert = myCustomLib.customAlert;
    alert();
}

Related Rules

Rule doesn't have all its properties in alphabetical order.
Open

.CodeMirror-gutters {
Severity: Minor
Found in src/client/codemirror.css by csslint

Outlines should only be modified using :focus.
Open

.CodeMirror-scroll {
Severity: Minor
Found in src/client/codemirror.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.cm-fat-cursor .CodeMirror-cursor {
Severity: Minor
Found in src/client/codemirror.css by csslint
Severity
Category
Status
Source
Language